]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
drain the reply queue always
authorAlan T. DeKok <aland@freeradius.org>
Thu, 8 Dec 2016 14:43:24 +0000 (09:43 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 8 Dec 2016 14:43:24 +0000 (09:43 -0500)
stubbed out, but may help...

src/tests/util/channel_test.c

index 36e164ef890f4d176efa1c54f62bb93e2d3ef6ed..4d8d5cc2f701ea4502cd45ddb691119bfafa93ec 100644 (file)
@@ -100,6 +100,19 @@ static void *channel_master(void *arg)
                int num_to_send;
                fr_channel_data_t *cd, *reply;
 
+#if 0
+               /*
+                *      Drain the input queues before sleeping.
+                */
+               while ((reply = fr_channel_recv_reply(channel)) != NULL) {
+                       num_replies++;
+                       num_outstanding--;
+                       MPRINT1("Master got reply %d, outstanding=%d, %d/%d sent.\n",
+                               num_replies, num_outstanding, num_messages, max_messages);
+                       fr_message_done(&reply->m);
+               }
+#endif
+
                /*
                 *      Ensure we have outstanding messages.
                 */
@@ -154,6 +167,7 @@ static void *channel_master(void *arg)
                 *      Signal close only when done.
                 */
 check_close:
+
                if (!signaled_close && (num_messages >= max_messages) && (num_outstanding == 0)) {
                        rcode = fr_channel_signal_worker_close(channel);
                        if (rcode < 0) {