s3:smb2_server: remember smbXsrv_connection for each smbd_smb2_request
authorStefan Metzmacher <metze@samba.org>
Tue, 10 Jun 2014 11:34:55 +0000 (13:34 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 6 Aug 2014 07:51:12 +0000 (09:51 +0200)
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>
source3/smbd/globals.h
source3/smbd/smb2_server.c

index 4e275eb9409b988e48caac05090acdba0015c541..8055d50181fca04ec87e6932eb949b0ae8422fed 100644 (file)
@@ -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;
 
index 16c6fd4134864939833cacf8bc60ecdaa7e493a6..7a0555dbd5d75630e74a450760a194894918c21c 100644 (file)
@@ -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);