From 5f237763f89ce13240a6e47dddc4dff60e26fa7f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 17 Sep 2011 19:56:50 +0200 Subject: s3:smb2cli: pass timeout to smb2cli_req_create/send() metze Autobuild-User: Stefan Metzmacher Autobuild-Date: Sun Sep 18 07:04:05 CEST 2011 on sn-devel-104 --- source3/libsmb/smb2cli_base.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/libsmb/smb2cli_base.c') diff --git a/source3/libsmb/smb2cli_base.c b/source3/libsmb/smb2cli_base.c index def7f57d45..f8b2f6e5df 100644 --- a/source3/libsmb/smb2cli_base.c +++ b/source3/libsmb/smb2cli_base.c @@ -178,6 +178,7 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx, uint16_t cmd, uint32_t additional_flags, uint32_t clear_flags, + unsigned int timeout, uint32_t pid, uint32_t tid, uint64_t uid, @@ -223,6 +224,15 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx, SIVAL(state->hdr, SMB2_HDR_TID, tid); SBVAL(state->hdr, SMB2_HDR_SESSION_ID, uid); + if (timeout > 0) { + struct timeval endtime; + + endtime = timeval_current_ofs_msec(timeout); + if (!tevent_req_set_endtime(req, ev, endtime)) { + return req; + } + } + return req; } @@ -333,6 +343,7 @@ struct tevent_req *smb2cli_req_send(TALLOC_CTX *mem_ctx, uint16_t cmd, uint32_t additional_flags, uint32_t clear_flags, + unsigned int timeout, uint32_t pid, uint32_t tid, uint64_t uid, @@ -346,6 +357,7 @@ struct tevent_req *smb2cli_req_send(TALLOC_CTX *mem_ctx, req = smb2cli_req_create(mem_ctx, ev, cli, cmd, additional_flags, clear_flags, + timeout, pid, tid, uid, fixed, fixed_len, dyn, dyn_len); if (req == NULL) { -- cgit