From: Alan T. DeKok Date: Tue, 24 Dec 2019 19:26:43 +0000 (-0500) Subject: whoops, set status, too X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d13a395e7684a2477edfeb2fdd6a1cd720bc0b71;p=thirdparty%2Ffreeradius-server.git whoops, set status, too --- diff --git a/src/modules/proto_control/conduit.c b/src/modules/proto_control/conduit.c index 32c84c44f53..08ff5eafc75 100644 --- a/src/modules/proto_control/conduit.c +++ b/src/modules/proto_control/conduit.c @@ -229,6 +229,11 @@ ssize_t fr_conduit_write(int fd, fr_conduit_type_t conduit, void const *out, siz return -1; } + /* + * Asked to write nothing, suppress it. + */ + if (!outlen) return 0; + hdr.conduit = htons(conduit); hdr.length = htonl(outlen); diff --git a/src/modules/proto_control/proto_control_unix.c b/src/modules/proto_control/proto_control_unix.c index 7e0be32c21b..4d87a1cd242 100644 --- a/src/modules/proto_control/proto_control_unix.c +++ b/src/modules/proto_control/proto_control_unix.c @@ -166,7 +166,10 @@ static ssize_t mod_read_command(fr_listen_t *li, UNUSED void **packet_ctx, UNUSE /* * If the write gives us nothing, send an empty SUCCESS back. */ - if (!hdr->length) goto done; + if (!hdr->length) { + status = FR_CONDUIT_SUCCESS; + goto done; + } /* * fr_command_run() expects a zero-terminated string...