]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't call write() if there's no data in the message
authorAlan T. DeKok <aland@freeradius.org>
Wed, 12 Jul 2017 15:43:12 +0000 (11:43 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 12 Jul 2017 15:43:12 +0000 (11:43 -0400)
src/lib/io/network.c

index 4e21871fcbd2456a2e8bd7b9e4f8f1ebfb745803..3088339cacf506df23c685b80c79cdbac586f849 100644 (file)
@@ -762,6 +762,14 @@ static void fr_network_post_event(UNUSED fr_event_list_t *el, UNUSED struct time
 
                listen = cd->listen;
 
+               /*
+                *      No data to write to the socket, so we skip it.
+                */
+               if (!cd->m.data_size) {
+                       fr_message_done(&cd->m);
+                       continue;
+               }
+
                /*
                 *      The write function is responsible for ensuring
                 *      that NAKs are not written to the network.