summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_tcon.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_tcon.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_tcon.c')
-rw-r--r--source3/smbd/smb2_tcon.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c
index 3eb9da29a0..c3e46eeb1c 100644
--- a/source3/smbd/smb2_tcon.c
+++ b/source3/smbd/smb2_tcon.c
@@ -231,15 +231,24 @@ NTSTATUS smbd_smb2_request_check_tcon(struct smbd_smb2_request *req)
in_tid = IVAL(inhdr, SMB2_HDR_TID);
- if (i > 2 && in_tid == (0xFFFFFFFF)) {
- /*
- * Chained request - fill in tid from
- * the previous request out.vector[].iov_base.
- */
- outhdr = (const uint8_t *)req->out.vector[i-3].iov_base;
- in_tid = IVAL(outhdr, SMB2_HDR_TID);
- chained_fixup = true;
- }
+ if (in_tid == (0xFFFFFFFF)) {
+ if (req->async) {
+ /*
+ * async request - fill in tid from
+ * already setup out.vector[].iov_base.
+ */
+ outhdr = (const uint8_t *)req->out.vector[i].iov_base;
+ in_tid = IVAL(outhdr, SMB2_HDR_TID);
+ } else if (i > 2) {
+ /*
+ * Chained request - fill in tid from
+ * the previous request out.vector[].iov_base.
+ */
+ outhdr = (const uint8_t *)req->out.vector[i-3].iov_base;
+ in_tid = IVAL(outhdr, SMB2_HDR_TID);
+ chained_fixup = true;
+ }
+ }
/* lookup an existing session */
p = idr_find(req->session->tcons.idtree, in_tid);