From 43e19be24c8d665f134194a1a7a939e65b9c324b Mon Sep 17 00:00:00 2001 From: Scott Lovenberg Date: Sun, 13 Sep 2015 07:26:15 -0500 Subject: [PATCH 1/2] misc : correct spelling mistake Signed-off-by: Scott Lovenberg --- source3/include/local.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/include/local.h b/source3/include/local.h index 7f97d4e..ffc91d3 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -122,7 +122,7 @@ /* shall we support browse requests via a FIFO to nmbd? */ #define ENABLE_FIFO 1 -/* how long (in miliseconds) to wait for a socket connect to happen */ +/* how long (in milliseconds) to wait for a socket connect to happen */ #define LONG_CONNECT_TIMEOUT 30000 #define SHORT_CONNECT_TIMEOUT 5000 From 9bd4f5a5d50b5d96c7d0a99ee8c776a50044fcc0 Mon Sep 17 00:00:00 2001 From: Scott Lovenberg Date: Sun, 13 Sep 2015 07:51:05 -0500 Subject: [PATCH 2/2] libcli : define and use old socket timeout value In source3 the socket timeout is defined as 30 seconds. Use that in source4 instead of the hard coded 15 seconds so socket timeouts are consistent. Signed-off-by: Scott Lovenberg --- source3/include/local.h | 3 ++- source4/lib/socket/socket.h | 3 +++ source4/libcli/raw/clisocket.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source3/include/local.h b/source3/include/local.h index ffc91d3..cce7715 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -122,7 +122,8 @@ /* shall we support browse requests via a FIFO to nmbd? */ #define ENABLE_FIFO 1 -/* how long (in milliseconds) to wait for a socket connect to happen */ +/* How long (in milliseconds) to wait for a socket connect to happen. + Also defined in source4/lib/socket/socket.h */ #define LONG_CONNECT_TIMEOUT 30000 #define SHORT_CONNECT_TIMEOUT 5000 diff --git a/source4/lib/socket/socket.h b/source4/lib/socket/socket.h index 403a723..881c6b4 100644 --- a/source4/lib/socket/socket.h +++ b/source4/lib/socket/socket.h @@ -20,6 +20,9 @@ #ifndef _SAMBA_SOCKET_H #define _SAMBA_SOCKET_H +/* See source3/include/local.h for source3 socket timeout definitions. */ +#define LONG_CONNECT_TIMEOUT 30000 + struct tevent_context; struct tevent_fd; struct socket_context; diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c index 1959a93..4e27617 100644 --- a/source4/libcli/raw/clisocket.c +++ b/source4/libcli/raw/clisocket.c @@ -298,7 +298,7 @@ static struct tevent_req *smbcli_sock_establish_send(TALLOC_CTX *mem_ctx, struct sock_connect_state *state = talloc_get_type_abort(private_data, struct sock_connect_state); - uint32_t timeout_msec = 15 * 1000; + uint32_t timeout_msec = LONG_CONNECT_TIMEOUT; return smbcli_transport_connect_send(state, ev,