summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-06-10 13:34:55 +0200
committerMichael Adam <obnox@samba.org>2014-08-06 09:51:12 +0200
commit39f55660929410ae4eaeba8e55b9d97a97d5e54a (patch)
treeb52239d0b76924fee08c9b224378a13867208215
parentb38cb03ab6e6c550cc7d1f525a8b56a62974b0fd (diff)
downloadsamba-39f55660929410ae4eaeba8e55b9d97a97d5e54a.tar.gz
samba-39f55660929410ae4eaeba8e55b9d97a97d5e54a.tar.xz
samba-39f55660929410ae4eaeba8e55b9d97a97d5e54a.zip
s3:smb2_server: remember smbXsrv_connection for each smbd_smb2_request
This prepares the structures for multi-channel support. Each request needs to respond on the same connection, where it arrived. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--source3/smbd/globals.h1
-rw-r--r--source3/smbd/smb2_server.c6
2 files changed, 5 insertions, 2 deletions
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 4e275eb940..8055d50181 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -624,6 +624,7 @@ struct smbd_smb2_request {
struct smbd_smb2_request *prev, *next;
struct smbd_server_connection *sconn;
+ struct smbXsrv_connection *xconn;
struct smbd_smb2_send_queue queue_entry;
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 16c6fd4134..7a0555dbd5 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -553,6 +553,7 @@ static NTSTATUS smbd_smb2_request_create(struct smbd_server_connection *sconn,
return NT_STATUS_NO_MEMORY;
}
req->sconn = sconn;
+ req->xconn = xconn;
talloc_steal(req, inbuf);
@@ -1152,18 +1153,18 @@ static bool dup_smb2_vec4(TALLOC_CTX *ctx,
static struct smbd_smb2_request *dup_smb2_req(const struct smbd_smb2_request *req)
{
- struct smbXsrv_connection *xconn = req->sconn->conn;
struct smbd_smb2_request *newreq = NULL;
struct iovec *outvec = NULL;
int count = req->out.vector_count;
int i;
- newreq = smbd_smb2_request_allocate(xconn);
+ newreq = smbd_smb2_request_allocate(req->xconn);
if (!newreq) {
return NULL;
}
newreq->sconn = req->sconn;
+ newreq->xconn = req->xconn;
newreq->session = req->session;
newreq->do_encryption = req->do_encryption;
newreq->do_signing = req->do_signing;
@@ -3000,6 +3001,7 @@ static NTSTATUS smbd_smb2_request_next_incoming(struct smbd_server_connection *s
return NT_STATUS_NO_MEMORY;
}
state->req->sconn = sconn;
+ state->req->xconn = xconn;
state->min_recv_size = lp_min_receive_file_size();
TEVENT_FD_READABLE(xconn->transport.fde);