summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-07 18:55:02 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-18 05:33:10 +0200
commitb6b767a2c47b26c1758520212b4f09ddb934c9f3 (patch)
treec007a7d876ae0b3a521cac8c2d09f3508971f9b7
parent46f64aafcbb66adfe42d7f4b26709878acfd3648 (diff)
downloadsamba-b6b767a2c47b26c1758520212b4f09ddb934c9f3.tar.gz
samba-b6b767a2c47b26c1758520212b4f09ddb934c9f3.tar.bz2
samba-b6b767a2c47b26c1758520212b4f09ddb934c9f3.zip
s3:smb2cli: only use tevent_req_defer_callback() if we have more than one smb2 response
metze
-rw-r--r--source3/libsmb/smb2cli_base.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/libsmb/smb2cli_base.c b/source3/libsmb/smb2cli_base.c
index 869c223b82..d26e1b4a25 100644
--- a/source3/libsmb/smb2cli_base.c
+++ b/source3/libsmb/smb2cli_base.c
@@ -515,6 +515,7 @@ static void smb2cli_inbuf_received(struct tevent_req *subreq)
ssize_t received;
int err;
size_t num_pending;
+ bool defer = true;
received = read_smb_recv(subreq, frame, &inbuf, &err);
TALLOC_FREE(subreq);
@@ -602,7 +603,13 @@ static void smb2cli_inbuf_received(struct tevent_req *subreq)
* There might be more than one response
* we need to defer the notifications
*/
- tevent_req_defer_callback(req, state->ev);
+ if ((num_iov == 4) && (talloc_array_length(cli->conn.pending) == 0)) {
+ defer = false;
+ }
+
+ if (defer) {
+ tevent_req_defer_callback(req, state->ev);
+ }
/*
* Note: here we use talloc_reference() in a way
@@ -623,6 +630,10 @@ static void smb2cli_inbuf_received(struct tevent_req *subreq)
TALLOC_FREE(frame);
+ if (!defer) {
+ return;
+ }
+
num_pending = talloc_array_length(cli->conn.pending);
if (num_pending == 0) {
if (state->cli->smb2.mid < UINT64_MAX) {