s4:libcli/raw: add transport->ev as copy of transport->socket->event.ctx
authorStefan Metzmacher <metze@samba.org>
Tue, 22 Nov 2011 08:36:30 +0000 (09:36 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 29 Nov 2011 15:00:08 +0000 (16:00 +0100)
We'll remove transport->socket soon, but removing transport->ev
will take a bit longer.

metze

source4/libcli/raw/clitransport.c
source4/libcli/raw/libcliraw.h
source4/libcli/raw/rawrequest.c
source4/libcli/smb_composite/appendacl.c
source4/libcli/smb_composite/loadfile.c
source4/libcli/smb_composite/savefile.c
source4/libcli/smb_composite/sesssetup.c
source4/libcli/util/clilsa.c

index b8df09ece32e44b956afaf908f8163b759712352..6f87e008080716e37b8a33dde456a55eccd17921 100644 (file)
@@ -88,6 +88,7 @@ struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock,
                transport->socket = talloc_reference(transport, sock);
        }
        transport->negotiate.protocol = PROTOCOL_NT1;
+       transport->ev = sock->event.ctx;
        transport->options = *options;
        transport->negotiate.max_xmit = transport->options.max_xmit;
 
index b7b02c668eaee6a83ea1b6efe660fab9698932e1..1009f4353a4726f30c72e9656f2d9df608b4f435 100644 (file)
@@ -108,6 +108,8 @@ struct smbcli_options {
 
 /* this is the context for the client transport layer */
 struct smbcli_transport {
+       struct tevent_context *ev; /* TODO: remove this !!! */
+
        /* socket level info */
        struct smbcli_socket *socket;
 
index 3b0cf7cabb2a1b86c4bc3a589f29392be16aef4e..ae68fb0cd36ee6592cfd642a61ad3af6a80a9d45 100644 (file)
@@ -358,7 +358,7 @@ bool smbcli_request_receive(struct smbcli_request *req)
 
        /* keep receiving packets until this one is replied to */
        while (req->state <= SMBCLI_REQUEST_RECV) {
-               if (tevent_loop_once(req->transport->socket->event.ctx) != 0) {
+               if (tevent_loop_once(req->transport->ev) != 0) {
                        return false;
                }
        }
index c1a964f151b22747335610b74d0080b95518c82b..792ea5a47ebfd823a85b5957fb793ab6b64e7293 100644 (file)
@@ -247,7 +247,7 @@ struct composite_context *smb_composite_appendacl_send(struct smbcli_tree *tree,
 
        c->private_data = state;
        c->state = COMPOSITE_STATE_IN_PROGRESS;
-       c->event_ctx = tree->session->transport->socket->event.ctx;
+       c->event_ctx = tree->session->transport->ev;
 
        /* setup structures for opening file */
        state->io_open = talloc_zero(c, union smb_open);
index 994c29c77db234fb525a33916a5229c2ce19497f..00456f18a4ede38c708adb2d28674590f09fef58 100644 (file)
@@ -229,7 +229,7 @@ struct composite_context *smb_composite_loadfile_send(struct smbcli_tree *tree,
 
        c->private_data = state;
        c->state = COMPOSITE_STATE_IN_PROGRESS;
-       c->event_ctx = tree->session->transport->socket->event.ctx;
+       c->event_ctx = tree->session->transport->ev;
 
        /* setup for the open */
        state->io_open = talloc_zero(c, union smb_open);
index 25a35c01a9e14cdb2959bdb86e26c8fcd8593acf..2f004430837a8f4dba543e88cd340a90e5f709e2 100644 (file)
@@ -225,7 +225,7 @@ struct composite_context *smb_composite_savefile_send(struct smbcli_tree *tree,
        if (c == NULL) goto failed;
 
        c->state = COMPOSITE_STATE_IN_PROGRESS;
-       c->event_ctx = tree->session->transport->socket->event.ctx;
+       c->event_ctx = tree->session->transport->ev;
 
        state = talloc(c, struct savefile_state);
        if (state == NULL) goto failed;
index 8b1571cc495e41d501d571a967ae4f21e496eab2..cafaacd8bbdf351eec72c9d4ffe57c87b88ea42d 100644 (file)
@@ -548,7 +548,7 @@ struct composite_context *smb_composite_sesssetup_send(struct smbcli_session *se
        struct sesssetup_state *state;
        NTSTATUS status;
 
-       c = composite_create(session, session->transport->socket->event.ctx);
+       c = composite_create(session, session->transport->ev);
        if (c == NULL) return NULL;
 
        state = talloc_zero(c, struct sesssetup_state);
index 4cfdf937259d141c2c5c9c3e81a3bb6af8fe5774..4a81457569d107dfb6e10df57947e652513a0cea 100644 (file)
@@ -79,7 +79,7 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli)
        }
        lsa->ipc_tree->tid = tcon.tconx.out.tid;
 
-       lsa->pipe = dcerpc_pipe_init(lsa, cli->transport->socket->event.ctx);
+       lsa->pipe = dcerpc_pipe_init(lsa, cli->transport->ev);
        if (lsa->pipe == NULL) {
                talloc_free(lsa);
                return NT_STATUS_NO_MEMORY;