summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-05-29 16:44:32 +0200
committerJeremy Allison <jra@samba.org>2014-05-31 01:59:17 +0200
commit8ddbf18115f2fc251a37d01907b572cc14161d01 (patch)
tree3e5651cf7d4b387f06105d53358c2cdd08c3552f
parent56a7ddd7779448f18233f6e1769bc34f11fa2e14 (diff)
downloadsamba-8ddbf18115f2fc251a37d01907b572cc14161d01.tar.gz
samba-8ddbf18115f2fc251a37d01907b572cc14161d01.tar.xz
samba-8ddbf18115f2fc251a37d01907b572cc14161d01.zip
messaging3: Add and use messaging_tevent_context()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/include/messages.h2
-rw-r--r--source3/lib/ctdbd_conn.c7
-rw-r--r--source3/lib/messages.c6
-rw-r--r--source3/lib/messages_dgm.c3
4 files changed, 14 insertions, 4 deletions
diff --git a/source3/include/messages.h b/source3/include/messages.h
index bea3fd0037..d029d66c27 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -116,6 +116,8 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
struct tevent_context *ev);
struct server_id messaging_server_id(const struct messaging_context *msg_ctx);
+struct tevent_context *messaging_tevent_context(
+ struct messaging_context *msg_ctx);
struct messaging_backend *messaging_local_backend(
struct messaging_context *msg_ctx);
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 35845eda76..201c700290 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -496,8 +496,8 @@ static NTSTATUS ctdb_read_req(struct ctdbd_connection *conn, uint32_t reqid,
* We're waiting for a call reply, but an async message has
* crossed. Defer dispatching to the toplevel event loop.
*/
- evt = tevent_add_timer(conn->msg_ctx->event_ctx,
- conn->msg_ctx->event_ctx,
+ evt = tevent_add_timer(messaging_tevent_context(conn->msg_ctx),
+ messaging_tevent_context(conn->msg_ctx),
timeval_zero(),
deferred_message_dispatch,
msg_state);
@@ -747,7 +747,8 @@ NTSTATUS ctdbd_register_msg_ctx(struct ctdbd_connection *conn,
SMB_ASSERT(conn->msg_ctx == NULL);
SMB_ASSERT(conn->fde == NULL);
- if (!(conn->fde = tevent_add_fd(msg_ctx->event_ctx, conn,
+ if (!(conn->fde = tevent_add_fd(messaging_tevent_context(msg_ctx),
+ conn,
ctdb_packet_get_fd(conn->pkt),
TEVENT_FD_READ,
ctdbd_socket_handler,
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index db7257dba5..3d838fe908 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -868,4 +868,10 @@ struct messaging_backend *messaging_local_backend(
return msg_ctx->local;
}
+struct tevent_context *messaging_tevent_context(
+ struct messaging_context *msg_ctx)
+{
+ return msg_ctx->event_ctx;
+}
+
/** @} **/
diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c
index cf6e19075a..9b58d9e033 100644
--- a/source3/lib/messages_dgm.c
+++ b/source3/lib/messages_dgm.c
@@ -232,7 +232,8 @@ NTSTATUS messaging_dgm_init(struct messaging_context *msg_ctx,
}
ctx->tevent_handle = poll_funcs_tevent_register(
- ctx, ctx->msg_callbacks, msg_ctx->event_ctx);
+ ctx, ctx->msg_callbacks,
+ messaging_tevent_context(msg_ctx));
if (ctx->tevent_handle == NULL) {
TALLOC_FREE(result);
return NT_STATUS_NO_MEMORY;