From 63b335b0ddd219f3c821a6e5d1d81ab1d6377ba1 Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Tue, 19 Mar 2024 14:23:09 -0400 Subject: [PATCH] Process load module writes --- src/listen/load/proto_load.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/listen/load/proto_load.c b/src/listen/load/proto_load.c index ee7416e0acf0c..04f3ca55913f6 100644 --- a/src/listen/load/proto_load.c +++ b/src/listen/load/proto_load.c @@ -179,10 +179,20 @@ static int mod_decode(void const *instance, request_t *request, uint8_t *const d */ static ssize_t mod_encode(UNUSED void const *instance, request_t *request, uint8_t *buffer, size_t buffer_len) { - if (buffer_len < 1) return -1; + if (buffer_len < 2) return -1; - *buffer = request->reply->code; - return 1; + buffer[0] = request->reply->code; + buffer[1] = 0x00; + + /* + * For some reason the rest of the code treats + * returning one byte of data as a magic + * "do not respond" value... It's unclear why. + * + * Return 2 to indicate we actually want our + * write functiont o run. + */ + return 2; } /** Open listen sockets/connect to external event source