summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_notify.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-04-17 21:20:17 -0700
committerJeremy Allison <jra@samba.org>2010-04-17 21:20:17 -0700
commitbf45b4f4fda2c4e0d697bb30720c780325c3cd84 (patch)
tree4e6bcc149469832e1126972cfcc8f0a24069e20e /source3/smbd/smb2_notify.c
parente0d6f1a6dafef712c90a5df21fa42791e5c9b140 (diff)
downloadsamba-bf45b4f4fda2c4e0d697bb30720c780325c3cd84.tar.gz
samba-bf45b4f4fda2c4e0d697bb30720c780325c3cd84.tar.bz2
samba-bf45b4f4fda2c4e0d697bb30720c780325c3cd84.zip
First part of fix for bug #7331 - Compound async SMB 2 requests don't work right.
Gets us handling SMB2 compound async requests similar to W2K8R2 (and triggers the same client bug in the Win7 redirector). Great thanks to Ira Cooper <samba@ira.wakeful.net> for helping with this and to Metze for the wonderful async framework. The one thing I need to fix to make us identical to W2K8R2 is that when a compound request goes async at the end W2K8R2 splits the replies up into a compound non-async reply followed by a separate async reply. Currently we're doing the whole thing in a compound reply. Jeremy.
Diffstat (limited to 'source3/smbd/smb2_notify.c')
-rw-r--r--source3/smbd/smb2_notify.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/smbd/smb2_notify.c b/source3/smbd/smb2_notify.c
index 8fa0744319..3d60ffb39c 100644
--- a/source3/smbd/smb2_notify.c
+++ b/source3/smbd/smb2_notify.c
@@ -108,6 +108,14 @@ static void smbd_smb2_request_notify_done(struct tevent_req *subreq)
NTSTATUS status;
NTSTATUS error; /* transport error */
+ if (req->cancelled) {
+ const uint8_t *inhdr = (const uint8_t *)req->in.vector[i].iov_base;
+ uint64_t mid = BVAL(inhdr, SMB2_HDR_MESSAGE_ID);
+ DEBUG(10,("smbd_smb2_request_notify_done: cancelled mid %llu\n",
+ (unsigned long long)mid ));
+ return;
+ }
+
status = smbd_smb2_notify_recv(subreq,
req,
&out_output_buffer);
@@ -364,6 +372,8 @@ static bool smbd_smb2_notify_cancel(struct tevent_req *req)
smbd_notify_cancel_by_smbreq(state->smb2req->sconn,
state->smbreq);
+ state->smb2req->cancelled = true;
+ tevent_req_done(req);
return true;
}