From f651f10fae1cee7cb4ef1b5ae3e18a4f9e439fcd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 26 Mar 2009 20:32:55 +0100 Subject: [PATCH] s3:net: add --request-timeout option metze (cherry picked from commit 257809558bfab3e45703cf8be76357596392a3ea) (cherry picked from commit e20b8706401d1a4eee0fe494825deef6ab23ab23) (cherry picked from commit d80e02de5714aaa650bef91767ce0775bd2392f5) --- source/utils/net.c | 1 + source/utils/net.h | 1 + source/utils/net_util.c | 2 ++ 3 files changed, 4 insertions(+) diff --git a/source/utils/net.c b/source/utils/net.c index f1a5be1876b..a8203b662e8 100644 --- a/source/utils/net.c +++ b/source/utils/net.c @@ -635,6 +635,7 @@ static struct functable net_func[] = { {"force", 'f', POPT_ARG_NONE, &c->opt_force}, {"stdin", 'i', POPT_ARG_NONE, &c->opt_stdin}, {"timeout", 't', POPT_ARG_INT, &c->opt_timeout}, + {"request-timeout",0,POPT_ARG_INT, &c->opt_request_timeout}, {"machine-pass",'P', POPT_ARG_NONE, &c->opt_machine_pass}, {"kerberos", 'k', POPT_ARG_NONE, &c->opt_kerberos}, {"myworkgroup", 'W', POPT_ARG_STRING, &c->opt_workgroup}, diff --git a/source/utils/net.h b/source/utils/net.h index 2d72756defb..d88f962d41e 100644 --- a/source/utils/net.h +++ b/source/utils/net.h @@ -43,6 +43,7 @@ struct net_context { const char *opt_container; int opt_flags; int opt_timeout; + int opt_request_timeout; const char *opt_target_workgroup; int opt_machine_pass; int opt_localgroup; diff --git a/source/utils/net_util.c b/source/utils/net_util.c index ee02942ad21..98dac4dcc15 100644 --- a/source/utils/net_util.c +++ b/source/utils/net_util.c @@ -521,6 +521,8 @@ NTSTATUS net_make_ipc_connection_ex(struct net_context *c ,const char *domain, d_fprintf(stderr, "Connection failed: %s\n", nt_errstr(nt_status)); cli = NULL; + } else if (c->opt_request_timeout) { + cli_set_timeout(cli, c->opt_request_timeout * 1000); } done: -- 2.11.4.GIT