msg_ctx = imessaging_init(frame,
lp_ctx,
*server_id,
- event_ctx, true);
+ event_ctx);
if (msg_ctx == NULL) {
DEBUG(1, ("imessaging_init failed\n"));
TALLOC_FREE(frame);
msg_ctx = imessaging_init(frame,
lp_ctx,
*server_id,
- event_ctx, true);
+ event_ctx);
if (msg_ctx == NULL) {
DEBUG(1, ("imessaging_init failed\n"));
TALLOC_FREE(frame);
* Note we MUST use the NULL context here, not the autofree context,
* to avoid side effects in forked children exiting.
*/
- msg = imessaging_init(NULL, lp_ctx, myself, winbind_event_context(),
- false);
+ msg = imessaging_init(NULL, lp_ctx, myself, winbind_event_context());
talloc_unlink(NULL, lp_ctx);
if (msg == NULL) {
/*
- remove our messaging socket and database entry
*/
int imessaging_cleanup(struct imessaging_context *msg)
{
/*
create the listening socket and setup the dispatcher
-
- use auto_remove=true when you want a destructor to remove the
- associated messaging socket and database entry on talloc free. Don't
- use this in processes that may fork and a child may talloc free this
- memory
*/
struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx,
struct server_id server_id,
- struct tevent_context *ev,
- bool auto_remove)
+ struct tevent_context *ev)
{
struct imessaging_context *msg;
bool ok;
goto fail;
}
- if (auto_remove) {
- talloc_set_destructor(msg, imessaging_cleanup);
- }
-
imessaging_register(msg, NULL, MSG_PING, ping_message);
imessaging_register(msg, NULL, MSG_REQ_POOL_USAGE, pool_message);
imessaging_register(msg, NULL, MSG_IRPC, irpc_handler);
/* This is because we are not in the s3 serverid database */
id.unique_id = SERVERID_UNIQUE_ID_NOT_TO_VERIFY;
- return imessaging_init(mem_ctx, lp_ctx, id, ev, true);
+ return imessaging_init(mem_ctx, lp_ctx, id, ev);
}
/*
a list of registered irpc server functions
struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx,
struct server_id server_id,
- struct tevent_context *ev,
- bool auto_remove);
+ struct tevent_context *ev);
int imessaging_cleanup(struct imessaging_context *msg);
struct imessaging_context *imessaging_client_init(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx,
ret->msg_ctx = imessaging_init(ret->mem_ctx,
lp_ctx,
server_id,
- ev, true);
+ ev);
} else {
ret->msg_ctx = imessaging_client_init(ret->mem_ctx,
lp_ctx,
imessaging_init(tctx,
tctx->lp_ctx,
cluster_id(0, MSG_ID1),
- data->ev, true),
+ data->ev),
"Failed to init first messaging context");
torture_assert(tctx, data->msg_ctx2 =
imessaging_init(tctx,
tctx->lp_ctx,
cluster_id(0, MSG_ID2),
- data->ev, true),
+ data->ev),
"Failed to init second messaging context");
/* register the server side function */
msg_server_ctx = imessaging_init(tctx,
tctx->lp_ctx, cluster_id(0, 1),
- ev, true);
+ ev);
torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context");
msg_client_ctx = imessaging_init(tctx,
tctx->lp_ctx,
cluster_id(0, 2),
- ev, true);
+ ev);
torture_assert(tctx, msg_client_ctx != NULL,
"msg_client_ctx imessaging_init() failed");
msg = imessaging_init(talloc_autofree_context(),
lp_ctx,
- cluster_id(0, SAMBA_PARENT_TASKID), event_ctx, false);
+ cluster_id(0, SAMBA_PARENT_TASKID), event_ctx);
NT_STATUS_HAVE_NO_MEMORY(msg);
status = irpc_add_name(msg, "samba");
/* setup to receive internal messages on this connection */
srv_conn->msg_ctx = imessaging_init(srv_conn,
lp_ctx,
- srv_conn->server_id, ev, false);
+ srv_conn->server_id, ev);
if (!srv_conn->msg_ctx) {
stream_terminate_connection(srv_conn, "imessaging_init() failed");
return;
task->msg_ctx = imessaging_init(task,
task->lp_ctx,
task->server_id,
- task->event_ctx, false);
+ task->event_ctx);
if (!task->msg_ctx) {
task_server_terminate(task, "imessaging_init() failed", true);
return;