summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ctdb/protocol/protocol_event.c13
-rw-r--r--ctdb/tests/src/protocol_event_test.c2
2 files changed, 10 insertions, 5 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:
diff --git a/ctdb/tests/src/protocol_event_test.c b/ctdb/tests/src/protocol_event_test.c
index c91791cb649..f8c94e32e5d 100644
--- a/ctdb/tests/src/protocol_event_test.c
+++ b/ctdb/tests/src/protocol_event_test.c
@@ -264,7 +264,7 @@ static void test_ctdb_event_reply(void)
PROTOCOL_TYPE3_TEST(struct ctdb_event_request_run, ctdb_event_request_run);
PROTOCOL_TYPE3_TEST(struct ctdb_event_request_status,
ctdb_event_request_status);
-DEFINE_TEST(struct ctdb_event_request_script_enable,
+PROTOCOL_TYPE3_TEST(struct ctdb_event_request_script_enable,
ctdb_event_request_script_enable);
DEFINE_TEST(struct ctdb_event_request_script_disable,
ctdb_event_request_script_disable);