]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: replace xconn->msg_ctx with xconn->client->msg_ctx
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Mar 2018 09:54:41 +0000 (10:54 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Jun 2018 06:59:18 +0000 (08:59 +0200)
This is the same pointer and we don't have a lot of callers,
so we can just use one pointer.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/globals.h
source3/smbd/process.c
source3/smbd/smbXsrv_client.c
source3/smbd/smbXsrv_open.c
source3/smbd/smbXsrv_session.c
source3/smbd/smbXsrv_tcon.c

index 4f4519465b0436257e89ce5243d25fe834ce2fb2..492430f9bbecaf6a253eb90147591ffe42426d7d 100644 (file)
@@ -368,8 +368,6 @@ struct smbXsrv_connection {
        const struct tsocket_address *remote_address;
        const char *remote_hostname;
 
-       struct messaging_context *msg_ctx;
-
        enum protocol_types protocol;
 
        struct {
index 48425a979ba29a1f8f1d42ed7f2fdd94fd21df82..53365b5f034521856bc1679bbf7ece957d8435b6 100644 (file)
@@ -3390,7 +3390,7 @@ bool fork_echo_handler(struct smbXsrv_connection *xconn)
                close(listener_pipe[0]);
                set_blocking(listener_pipe[1], false);
 
-               status = smbd_reinit_after_fork(xconn->msg_ctx,
+               status = smbd_reinit_after_fork(xconn->client->msg_ctx,
                                                xconn->client->raw_ev_ctx,
                                                true,
                                                "smbd-echo");
@@ -3702,7 +3702,6 @@ NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd,
        }
        talloc_steal(frame, xconn);
 
-       xconn->msg_ctx = client->msg_ctx;
        xconn->transport.sock = sock_fd;
        smbd_echo_init(xconn);
        xconn->protocol = PROTOCOL_NONE;
index 3e0a1d51e5aecca2ad744d400ab5e87f4df2b134..4cae8c5287e20758796d774e4a0cfc8c8eec556e 100644 (file)
@@ -345,7 +345,7 @@ NTSTATUS smb2srv_client_connection_pass(struct smbd_smb2_request *smb2req,
        iov.iov_base = blob.data;
        iov.iov_len = blob.length;
 
-       status = messaging_send_iov(smb2req->xconn->msg_ctx,
+       status = messaging_send_iov(smb2req->xconn->client->msg_ctx,
                                    global->server_id,
                                    MSG_SMBXSRV_CONNECTION_PASS,
                                    &iov, 1,
index 4ad0021cdf4f5f8832b85d1d518fd4d75522ceeb..2a2cf6973e7da28f415737b99677469531d07783 100644 (file)
@@ -871,7 +871,7 @@ NTSTATUS smbXsrv_open_create(struct smbXsrv_connection *conn,
        global->open_persistent_id = global->open_global_id;
        global->open_volatile_id = op->local_id;
 
-       global->server_id = messaging_server_id(conn->msg_ctx);
+       global->server_id = messaging_server_id(conn->client->msg_ctx);
        global->open_time = now;
        global->open_owner = *current_sid;
        if (conn->protocol >= PROTOCOL_SMB2_10) {
@@ -1416,7 +1416,7 @@ NTSTATUS smb2srv_open_recreate(struct smbXsrv_connection *conn,
        op->status = NT_STATUS_FILE_CLOSED;
 
        op->global->open_volatile_id = op->local_id;
-       op->global->server_id = messaging_server_id(conn->msg_ctx);
+       op->global->server_id = messaging_server_id(conn->client->msg_ctx);
 
        ptr = op;
        val = make_tdb_data((uint8_t const *)&ptr, sizeof(ptr));
index 2c5b2ffe2fcde98b49bc49cd63d1836986f90365..3d8f0be06efa5c9ece67af7b466628f6ced649af 100644 (file)
@@ -1110,7 +1110,7 @@ static void smb2srv_session_close_previous_check(struct tevent_req *req)
                return;
        }
 
-       status = messaging_send(conn->msg_ctx,
+       status = messaging_send(conn->client->msg_ctx,
                                global->channels[0].server_id,
                                MSG_SMBXSRV_SESSION_CLOSE, &blob);
        TALLOC_FREE(state->db_rec);
@@ -1362,7 +1362,7 @@ NTSTATUS smbXsrv_session_add_channel(struct smbXsrv_session *session,
        c = &global->channels[global->num_channels];
        ZERO_STRUCTP(c);
 
-       c->server_id = messaging_server_id(conn->msg_ctx);
+       c->server_id = messaging_server_id(conn->client->msg_ctx);
        c->local_address = tsocket_address_string(conn->local_address,
                                                  global->channels);
        if (c->local_address == NULL) {
index 5ad557e1f5e6ce35fb25606c78626f863eb5f7cd..627eeb166d9a1138f93c76596b956df943675b52 100644 (file)
@@ -1095,7 +1095,7 @@ NTSTATUS smb1srv_tcon_create(struct smbXsrv_connection *conn,
                             NTTIME now,
                             struct smbXsrv_tcon **_tcon)
 {
-       struct server_id id = messaging_server_id(conn->msg_ctx);
+       struct server_id id = messaging_server_id(conn->client->msg_ctx);
 
        return smbXsrv_tcon_create(conn->client->tcon_table,
                                   conn->protocol,