[PATCH] Remove hardcoded timeout and use CLIENT_TIMEOUT.

Scott Lovenberg scott.lovenberg at gmail.com
Wed Nov 28 10:29:53 MST 2012


On Wed, Nov 28, 2012 at 12:20 PM, Jelmer Vernooij <jelmer at canonical.com> wrote:
> Hi Scott,
>
> Thanks for the patch.
>
> On Wed, Nov 28, 2012 at 12:00:16PM -0500, scott.lovenberg at gmail.com wrote:
>> From: Scott Lovenberg <scott.lovenberg at gmail.com>
>>
>> When initialising a client structure, use defined CLIENT_TIMEOUT instead of hardcoding 20 seconds as the default value.
>>
>> Signed-off-by: Scott Lovenberg <scott.lovenberg at gmail.com>
>> ---
>>  source3/libsmb/clientgen.c |    4 +++-
>>  1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
>> index 6bc8d0c..8a719d8 100644
>> --- a/source3/libsmb/clientgen.c
>> +++ b/source3/libsmb/clientgen.c
>> @@ -26,6 +26,8 @@
>>  #include "async_smb.h"
>>  #include "../libcli/smb/smbXcli_base.h"
>>  #include "../librpc/ndr/libndr.h"
>> +#include "../client/client.c"
>
> Including C files, especially ones that aren't trivial and have lots
> of unnecessary code, is usually a bad idea. It might make more
> sense to move that constant out from client.c to one of the header
> files that is shared by libsmb/clientgen.c and client/client.c ?
>
> Cheers,
>
> Jelmer

That's actually exactly what I was thinking.  TBH, it could be moved
to clientgen.c since it's never actually used anywhere.  The closest
to being used is in client/clitar.c where it's #ifndef'ed and
redefined.  It's never used there, either, so I'll submit a patch that
removes that.

Would it be reasonable to move the definition to include.h?
-- 
Peace and Blessings,
-Scott.


More information about the samba-technical mailing list