From: Alan T. DeKok Date: Thu, 8 Dec 2016 14:43:24 +0000 (-0500) Subject: drain the reply queue always X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d98120ec8495db994b1e2c51574748bfb6bb5496;p=thirdparty%2Ffreeradius-server.git drain the reply queue always stubbed out, but may help... --- diff --git a/src/tests/util/channel_test.c b/src/tests/util/channel_test.c index 36e164ef890..4d8d5cc2f70 100644 --- a/src/tests/util/channel_test.c +++ b/src/tests/util/channel_test.c @@ -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) {