Skip to content

Commit

Permalink
Process load module writes
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Mar 19, 2024
1 parent 9740d0d commit 63b335b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/listen/load/proto_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 63b335b

Please sign in to comment.