From 39f55660929410ae4eaeba8e55b9d97a97d5e54a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 10 Jun 2014 13:34:55 +0200 Subject: 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 Reviewed-by: Volker Lendecke Reviewed-by: Michael Adam --- source3/smbd/globals.h | 1 + source3/smbd/smb2_server.c | 6 ++++-- 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); -- cgit