mirror of
https://github.com/samba-team/samba.git
synced 2025-03-01 04:58:35 +03:00
messaging3: Add and use messaging_tevent_context()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
56a7ddd777
commit
8ddbf18115
@ -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);
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/** @} **/
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user