summaryrefslogtreecommitdiff
path: root/source3/libsmb/smb2cli_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libsmb/smb2cli_base.c')
-rw-r--r--source3/libsmb/smb2cli_base.c12
1 files changed, 12 insertions, 0 deletions
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) {