Clean up client timeout definitions [rev. 2]
authorScott Lovenberg <scott.lovenberg@gmail.com>
Tue, 4 Dec 2012 14:15:38 +0000 (09:15 -0500)
committerJeremy Allison <jra@samba.org>
Thu, 6 Dec 2012 02:25:58 +0000 (03:25 +0100)
The definitions for default client timeout values have been moved to client.h.  When initializing a client struct we use this value instead of the old hardcoded value.  The timeout value remains 20 seconds.

Signed-off-by: Scott Lovenberg <scott.lovenberg@gmail.com>
Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Dec  6 03:25:58 CET 2012 on sn-devel-104

source3/client/client.c
source3/client/clitar.c
source3/include/client.h
source3/libsmb/clientgen.c

index 0e2e07bd71d08d56594d142ff1ed067f4a865d16..6aed9d3891db8b1c23d70806ebaebc51055dc115 100644 (file)
@@ -65,10 +65,6 @@ static int cmd_help(void);
 
 #define CREATE_ACCESS_READ READ_CONTROL_ACCESS
 
-/* 30 second timeout on most commands */
-#define CLIENT_TIMEOUT (30*1000)
-#define SHORT_TIMEOUT (5*1000)
-
 /* value for unused fid field in trans2 secondary request */
 #define FID_UNUSED (0xFFFF)
 
index d3525719f5e2449688302ceba10a631ff4950895..7bbd6ad97552ff4ab0f5eacc214ff8c25b91d9ed 100644 (file)
@@ -73,9 +73,6 @@ extern struct cli_state *cli;
 
 static uint16 attribute = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
 
-#ifndef CLIENT_TIMEOUT
-#define CLIENT_TIMEOUT (30*1000)
-#endif
 
 static char *tarbuf, *buffer_p;
 static int tp, ntarf, tbufsiz;
index f6aaceaea659f43e98f0aa0037e31d660a3cb2e6..52e2212c06c829a37eda7b622e3379c65f5406a3 100644 (file)
@@ -24,6 +24,9 @@
 
 #define CLI_BUFFER_SIZE (0xFFFF)
 
+/* default client timeout to 20 seconds on most commands */
+#define CLIENT_TIMEOUT (20 * 1000)
+
 /*
  * These definitions depend on smb.h
  */
index 6bc8d0ce70855120926289cbc39d6fa470d45ab0..98ea7113a29b531e92a9d12a9eea8122f8c42a9f 100644 (file)
@@ -26,6 +26,7 @@
 #include "async_smb.h"
 #include "../libcli/smb/smbXcli_base.h"
 #include "../librpc/ndr/libndr.h"
+#include "../include/client.h"
 
 /*******************************************************************
  Setup the word count and byte count for a client smb message.
@@ -175,7 +176,7 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
        }
        cli->raw_status = NT_STATUS_INTERNAL_ERROR;
        cli->map_dos_errors = true; /* remove this */
-       cli->timeout = 20000; /* Timeout is in milliseconds. */
+       cli->timeout = CLIENT_TIMEOUT;
        cli->case_sensitive = false;
 
        /* Set the CLI_FORCE_DOSERR environment variable to test