Allowing the timeout in source4/libcli/raw/clisocket.c to be set from an environment var

Richard Sharpe realrichardsharpe at gmail.com
Thu Sep 10 00:44:14 UTC 2015


Hi folks,

Is this of any use to people?

diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index dd3ea39..9a35636 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -262,6 +262,8 @@ struct sock_connect_state {
 /*
   connect a smbcli_socket context to an IP/port pair
   if port is 0 then choose 445 then 139
+
+  Timeout can be in msec and in the env.
 */

 static struct tevent_req *smbcli_sock_establish_send(TALLOC_CTX *mem_ctx,
@@ -274,6 +276,10 @@ static struct tevent_req *smbcli_sock_establish_send(TALLOC
                talloc_get_type_abort(private_data,
                struct sock_connect_state);
        uint32_t timeout_msec = 15 * 1000;
+       int env_timeout = atoi(getenv("TORTURE_IO_TIMEOUT"));
+
+       if (env_timeout > 0)
+               timeout_msec = env_timeout;

        return smbcli_transport_connect_send(state,
                                             ev,


-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)



More information about the samba-technical mailing list