summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-10-17 17:10:29 +0000
committerJeremy Allison <jra@samba.org>2002-10-17 17:10:29 +0000
commit389a16d9d5331ddc7ae61d3d4ef3a4ee48734d4b (patch)
treec1befae62be9d225a39f3a32c814f9ab27853bf9 /source3/libsmb
parent8cb53d56f21f5a33d7dc55e7bd7cd559a112ac52 (diff)
downloadsamba-389a16d9d5331ddc7ae61d3d4ef3a4ee48734d4b.tar.gz
samba-389a16d9d5331ddc7ae61d3d4ef3a4ee48734d4b.tar.bz2
samba-389a16d9d5331ddc7ae61d3d4ef3a4ee48734d4b.zip
Added new error codes. Fix up connection code to retry in the same way
that app-head does. Jeremy. (This used to be commit b521abd86b10573ca8f9116907c81e6deb55f049)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index f005ac21f3..6a21121f43 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1153,6 +1153,7 @@ static void init_creds(struct ntuser_creds *creds, char* username,
@param user Username, unix string
@param domain User's domain
@param password User's password, unencrypted unix string.
+ @param retry BOOL. Did this connection fail with a retryable error ?
*/
NTSTATUS cli_full_connection(struct cli_state **output_cli,
@@ -1161,7 +1162,8 @@ NTSTATUS cli_full_connection(struct cli_state **output_cli,
struct in_addr *dest_ip, int port,
char *service, char *service_type,
char *user, char *domain,
- char *password, int flags)
+ char *password, int flags,
+ BOOL *retry)
{
struct ntuser_creds creds;
NTSTATUS nt_status;
@@ -1171,6 +1173,9 @@ NTSTATUS cli_full_connection(struct cli_state **output_cli,
struct in_addr ip;
extern pstring global_myname;
+ if (retry)
+ *retry = False;
+
if (!my_name)
my_name = global_myname;
@@ -1185,6 +1190,8 @@ NTSTATUS cli_full_connection(struct cli_state **output_cli,
return NT_STATUS_UNSUCCESSFUL;
}
+ cli_set_timeout(cli, 10000); /* 10 seconds. */
+
if (dest_ip)
ip = *dest_ip;
else
@@ -1201,6 +1208,9 @@ again:
return NT_STATUS_UNSUCCESSFUL;
}
+ if (retry)
+ *retry = True;
+
if (!cli_session_request(cli, &calling, &called)) {
char *p;
DEBUG(1,("session request to %s failed (%s)\n",