struct messaging_dgm_context *local;
struct messaging_backend *remote;
-
- bool *have_context;
};
-static int messaging_context_destructor(struct messaging_context *msg_ctx);
-
/****************************************************************************
A useful function for testing the message system.
****************************************************************************/
struct messaging_context *ctx;
NTSTATUS status;
int ret;
- static bool have_context = false;
-
- if (have_context) {
- DEBUG(0, ("No two messaging contexts per process\n"));
- return NULL;
- }
-
if (!(ctx = talloc_zero(mem_ctx, struct messaging_context))) {
return NULL;
ctx->id = procid_self();
ctx->event_ctx = ev;
- ctx->have_context = &have_context;
sec_init();
register_dmalloc_msgs(ctx);
debug_register_msgs(ctx);
- have_context = true;
- talloc_set_destructor(ctx, messaging_context_destructor);
-
return ctx;
}
-static int messaging_context_destructor(struct messaging_context *msg_ctx)
-{
- SMB_ASSERT(*msg_ctx->have_context);
- *msg_ctx->have_context = false;
- return 0;
-}
-
struct server_id messaging_server_id(const struct messaging_context *msg_ctx)
{
return msg_ctx->id;