summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2018-03-22 10:54:41 +0100
committerStefan Metzmacher <metze@samba.org>2018-06-18 08:59:18 +0200
commitd39f6ce3b1ac9f70040e8140937280f445d2d861 (patch)
tree141829e8940a522379b2b7e1ea6928c5c66f4337
parent19119a55490bcfacbc7d4be340f650e9eaf212f2 (diff)
downloadsamba-d39f6ce3b1ac9f70040e8140937280f445d2d861.tar.gz
smbd: replace xconn->ev_ctx with xconn->client->raw_ev_ctx
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>
-rw-r--r--source3/smbd/globals.h2
-rw-r--r--source3/smbd/oplock.c3
-rw-r--r--source3/smbd/process.c18
-rw-r--r--source3/smbd/smb2_server.c3
4 files changed, 15 insertions, 11 deletions
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 057645bedee..4f4519465b0 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -364,12 +364,10 @@ struct smbXsrv_connection {
struct smbXsrv_client *client;
-
const struct tsocket_address *local_address;
const struct tsocket_address *remote_address;
const char *remote_hostname;
- struct tevent_context *ev_ctx;
struct messaging_context *msg_ctx;
enum protocol_types protocol;
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 0f95bb01398..6d37f35babe 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -576,7 +576,8 @@ NTSTATUS downgrade_lease(struct smbXsrv_connection *xconn,
lck->data->modified = true;
}
- tevent_schedule_immediate(state->im, xconn->ev_ctx,
+ tevent_schedule_immediate(state->im,
+ xconn->client->raw_ev_ctx,
downgrade_lease_additional_trigger,
state);
}
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 581fd605e72..48425a979ba 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -2738,8 +2738,10 @@ static int release_ip(struct tevent_context *ev,
* as we might be called from within ctdbd_migrate(),
* we need to defer our action to the next event loop
*/
- tevent_schedule_immediate(state->im, xconn->ev_ctx,
- smbd_release_ip_immediate, state);
+ tevent_schedule_immediate(state->im,
+ xconn->client->raw_ev_ctx,
+ smbd_release_ip_immediate,
+ state);
/*
* Make sure we don't get any io on the connection.
@@ -3388,14 +3390,16 @@ 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, xconn->ev_ctx,
- true, "smbd-echo");
+ status = smbd_reinit_after_fork(xconn->msg_ctx,
+ xconn->client->raw_ev_ctx,
+ true,
+ "smbd-echo");
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("reinit_after_fork failed: %s\n",
nt_errstr(status)));
exit(1);
}
- initialize_password_db(true, xconn->ev_ctx);
+ initialize_password_db(true, xconn->client->raw_ev_ctx);
smbd_echo_loop(xconn, listener_pipe[1]);
exit(0);
}
@@ -3409,7 +3413,8 @@ bool fork_echo_handler(struct smbXsrv_connection *xconn)
* Without smb signing this is the same as the normal smbd
* listener. This needs to change once signing comes in.
*/
- xconn->smb1.echo_handler.trusted_fde = tevent_add_fd(xconn->ev_ctx,
+ xconn->smb1.echo_handler.trusted_fde = tevent_add_fd(
+ xconn->client->raw_ev_ctx,
xconn,
xconn->smb1.echo_handler.trusted_fd,
TEVENT_FD_READ,
@@ -3697,7 +3702,6 @@ NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd,
}
talloc_steal(frame, xconn);
- xconn->ev_ctx = client->raw_ev_ctx;
xconn->msg_ctx = client->msg_ctx;
xconn->transport.sock = sock_fd;
smbd_echo_init(xconn);
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index ed718b83958..b65172253b4 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -227,7 +227,8 @@ static NTSTATUS smbd_initialize_smb2(struct smbXsrv_connection *xconn,
return NT_STATUS_NO_MEMORY;
}
- xconn->transport.fde = tevent_add_fd(xconn->ev_ctx,
+ xconn->transport.fde = tevent_add_fd(
+ xconn->client->raw_ev_ctx,
xconn,
xconn->transport.sock,
TEVENT_FD_READ,