]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
whoops, set status, too
authorAlan T. DeKok <aland@freeradius.org>
Tue, 24 Dec 2019 19:26:43 +0000 (14:26 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 24 Dec 2019 19:26:43 +0000 (14:26 -0500)
src/modules/proto_control/conduit.c
src/modules/proto_control/proto_control_unix.c

index 32c84c44f531cf84e4933c3a50ad780e625e47dc..08ff5eafc75818ab6012e7b16e0611c095f46289 100644 (file)
@@ -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);
 
index 7e0be32c21bcd480289b3c18fbd8d944212f5446..4d87a1cd2424390745771167c3463b468033af9e 100644 (file)
@@ -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...