diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-10 08:35:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:19:31 -0500 |
commit | 056096c30ba73cbc5304c99af5d5a08d89111aab (patch) | |
tree | 411dade1ba4bbfc5a958515d300e0227893a86e1 /source4/lib | |
parent | e43e8fcf55e55fa2cc54b83c8a4111f3a6e4eae7 (diff) | |
download | samba-056096c30ba73cbc5304c99af5d5a08d89111aab.tar.gz samba-056096c30ba73cbc5304c99af5d5a08d89111aab.tar.bz2 samba-056096c30ba73cbc5304c99af5d5a08d89111aab.zip |
r8284: - fixed some uninitialised variables in the irpc code
- added code to send multiple irpc calls in parallel, to all servers
that have registered the given name, with output going in
io.results[i]. This allows you to make rpc calls to multiple servers
at once, which is needed for clients like smbstatus
(This used to be commit 061e20e509d95ffe16d7dd6fba7db39fc7a165ed)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/messaging/messaging.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index 5afcf91bab..a29f14f065 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -375,6 +375,10 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id return NULL; } + if (ev == NULL) { + ev = event_context_init(msg); + } + /* create the messaging directory if needed */ path = smbd_tmp_path(msg, "messaging"); mkdir(path, 0700); @@ -483,6 +487,7 @@ static void irpc_handler_reply(struct messaging_context *msg_ctx, irpc->status = header->status; } irpc->done = True; + talloc_steal(irpc, ndr); if (irpc->async.fn) { irpc->async.fn(irpc); } @@ -572,7 +577,9 @@ static void irpc_handler(struct messaging_context *msg_ctx, void *private, irpc_handler_reply(msg_ctx, ndr, &header); } else { irpc_handler_request(msg_ctx, ndr, &header, src); + talloc_free(ndr); } + return; failed: talloc_free(ndr); @@ -674,16 +681,13 @@ failed: */ NTSTATUS irpc_call_recv(struct irpc_request *irpc) { - NTSTATUS status; NT_STATUS_HAVE_NO_MEMORY(irpc); while (!irpc->done) { if (event_loop_once(irpc->msg_ctx->event.ev) != 0) { return NT_STATUS_CONNECTION_DISCONNECTED; } } - status = irpc->status; - talloc_free(irpc); - return status; + return irpc->status; } /* |