summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-09-12 10:02:02 +1000
committerAndrew Tridgell <tridge@samba.org>2010-09-15 15:39:34 +1000
commitf6d85be52830d17dbf6e7b01bf854a49dccbc7f8 (patch)
tree7a518bc54a292b100301fb7cd40486b52239d06d /source4/lib
parentb9393e48963bb0e800383d5fdf6888b472d44fb2 (diff)
downloadsamba-f6d85be52830d17dbf6e7b01bf854a49dccbc7f8.tar.gz
samba-f6d85be52830d17dbf6e7b01bf854a49dccbc7f8.tar.bz2
samba-f6d85be52830d17dbf6e7b01bf854a49dccbc7f8.zip
s4-messaging: add support for no_reply in irpc messages
It can be useful for a irpc message to be one-way, where the client sends a messages and the server does not reply. This will be used for things like a triger message from an auth context to the drepl server to tell it to try a REPL_SECRET on a user in a RODC. Previously we've used raw messaging for messages that have no reply, but that doesn't allow us to use messages described by IDL Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/messaging/irpc.h1
-rw-r--r--source4/lib/messaging/messaging.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h
index 4b497959ee..2a76461954 100644
--- a/source4/lib/messaging/irpc.h
+++ b/source4/lib/messaging/irpc.h
@@ -35,6 +35,7 @@ struct irpc_message {
struct irpc_header header;
struct ndr_pull *ndr;
bool defer_reply;
+ bool no_reply;
struct messaging_context *msg_ctx;
struct irpc_list *irpc;
void *data;
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c
index ae3f908060..c33db825fc 100644
--- a/source4/lib/messaging/messaging.c
+++ b/source4/lib/messaging/messaging.c
@@ -776,6 +776,7 @@ static void irpc_handler_request(struct messaging_context *msg_ctx,
/* make the call */
m->private_data= i->private_data;
m->defer_reply = false;
+ m->no_reply = false;
m->msg_ctx = msg_ctx;
m->irpc = i;
m->data = r;
@@ -783,6 +784,12 @@ static void irpc_handler_request(struct messaging_context *msg_ctx,
m->header.status = i->fn(m, r);
+ if (m->no_reply) {
+ /* the server function won't ever be replying to this request */
+ talloc_free(m);
+ return;
+ }
+
if (m->defer_reply) {
/* the server function has asked to defer the reply to later */
talloc_steal(msg_ctx, m);