summaryrefslogtreecommitdiff
path: root/ctdb/protocol/protocol_event.c
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2017-07-27 01:45:44 +1000
committerMartin Schwenke <martins@samba.org>2017-08-30 14:59:26 +0200
commitab88bad3e2a5a55f7f69e9a42c03d3f63123b2f5 (patch)
treed53f161fcdac38f775ac9db0c95a9dd4d38683d4 /ctdb/protocol/protocol_event.c
parent4788016cfda7446566063e7299c2d3e175fe5658 (diff)
downloadsamba-ab88bad3e2a5a55f7f69e9a42c03d3f63123b2f5.tar.gz
ctdb-protocol: Fix marshalling for ctdb_event_reply_script_list
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/protocol/protocol_event.c')
-rw-r--r--ctdb/protocol/protocol_event.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ctdb/protocol/protocol_event.c b/ctdb/protocol/protocol_event.c
index 1f608ad8ea1..d7ea6593105 100644
--- a/ctdb/protocol/protocol_event.c
+++ b/ctdb/protocol/protocol_event.c
@@ -645,17 +645,20 @@ static size_t ctdb_event_reply_script_list_len(
static void ctdb_event_reply_script_list_push(
struct ctdb_event_reply_script_list *in,
- uint8_t *buf)
+ uint8_t *buf, size_t *npush)
{
size_t np;
ctdb_script_list_push(in->script_list, buf, &np);
+
+ *npush = np;
}
static int ctdb_event_reply_script_list_pull(
uint8_t *buf, size_t buflen,
TALLOC_CTX *mem_ctx,
- struct ctdb_event_reply_script_list **out)
+ struct ctdb_event_reply_script_list **out,
+ size_t *npull)
{
struct ctdb_event_reply_script_list *rdata;
size_t np;
@@ -674,6 +677,7 @@ static int ctdb_event_reply_script_list_pull(
}
*out = rdata;
+ *npull = np;
return 0;
}
@@ -727,7 +731,7 @@ static void ctdb_event_reply_data_push(struct ctdb_event_reply_data *in,
case CTDB_EVENT_COMMAND_SCRIPT_LIST:
ctdb_event_reply_script_list_push(in->data.script_list,
- buf+offset);
+ buf+offset, &np);
break;
case CTDB_EVENT_COMMAND_SCRIPT_ENABLE:
@@ -771,7 +775,7 @@ static int ctdb_event_reply_data_pull(uint8_t *buf, size_t buflen,
case CTDB_EVENT_COMMAND_SCRIPT_LIST:
ret = ctdb_event_reply_script_list_pull(
buf+offset, buflen-offset,
- mem_ctx, &out->data.script_list);
+ mem_ctx, &out->data.script_list, &np);
break;
case CTDB_EVENT_COMMAND_SCRIPT_ENABLE: