s3: Restore correct timeouts for SMB requests
[idra/samba.git] / source3 / libsmb / async_smb.c
index ce225f4e00b14d6487c0f3f5cd4f081d6f63f7ae..8b9cf091c67d86ebda5f51c71eec91ed8cc9476b 100644 (file)
@@ -382,6 +382,7 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx,
 {
        struct tevent_req *result;
        struct cli_smb_state *state;
+       struct timeval endtime;
 
        if (iov_count > MAX_SMB_IOV) {
                /*
@@ -422,6 +423,10 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx,
        }
        state->iov_count = iov_count + 3;
 
+       endtime = timeval_current_ofs(0, cli->timeout * 1000);
+       if (!tevent_req_set_endtime(result, ev, endtime)) {
+               tevent_req_nomem(NULL, result);
+       }
        return result;
 }