summaryrefslogtreecommitdiff
path: root/ctdb/protocol
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2017-07-27 01:35:20 +1000
committerMartin Schwenke <martins@samba.org>2017-08-30 14:59:26 +0200
commit933a0fa73c02545116d300c16d9f4a5b7edb445c (patch)
tree9354932386c48e6fd68e26fe14466bfb80cd4f02 /ctdb/protocol
parent98715abef3cf2b4b6e074b00c03874f863b502e5 (diff)
downloadsamba-933a0fa73c02545116d300c16d9f4a5b7edb445c.tar.gz
ctdb-protocol: Fix marshalling for ctdb_event_request_script_enable
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/protocol')
-rw-r--r--ctdb/protocol/protocol_event.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ctdb/protocol/protocol_event.c b/ctdb/protocol/protocol_event.c
index d1cca15d352..9f1572d0047 100644
--- a/ctdb/protocol/protocol_event.c
+++ b/ctdb/protocol/protocol_event.c
@@ -373,17 +373,20 @@ static size_t ctdb_event_request_script_enable_len(
static void ctdb_event_request_script_enable_push(
struct ctdb_event_request_script_enable *in,
- uint8_t *buf)
+ uint8_t *buf, size_t *npush)
{
size_t np;
ctdb_stringn_push(&in->script_name, buf, &np);
+
+ *npush = np;
}
static int ctdb_event_request_script_enable_pull(
uint8_t *buf, size_t buflen,
TALLOC_CTX *mem_ctx,
- struct ctdb_event_request_script_enable **out)
+ struct ctdb_event_request_script_enable **out,
+ size_t *npull)
{
struct ctdb_event_request_script_enable *rdata;
size_t np;
@@ -401,6 +404,7 @@ static int ctdb_event_request_script_enable_pull(
}
*out = rdata;
+ *npull = np;
return 0;
}
@@ -499,7 +503,7 @@ static void ctdb_event_request_data_push(struct ctdb_event_request_data *in,
case CTDB_EVENT_COMMAND_SCRIPT_ENABLE:
ctdb_event_request_script_enable_push(
in->data.script_enable,
- buf+offset);
+ buf+offset, &np);
break;
case CTDB_EVENT_COMMAND_SCRIPT_DISABLE:
@@ -546,7 +550,8 @@ static int ctdb_event_request_data_pull(uint8_t *buf, size_t buflen,
ret = ctdb_event_request_script_enable_pull(
buf+offset, buflen-offset,
mem_ctx,
- &out->data.script_enable);
+ &out->data.script_enable,
+ &np);
break;
case CTDB_EVENT_COMMAND_SCRIPT_DISABLE: