]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Correct logic for master -> worker signals
authorAlan T. DeKok <aland@freeradius.org>
Mon, 12 Dec 2016 17:42:20 +0000 (12:42 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 12 Dec 2016 17:43:39 +0000 (12:43 -0500)
Which results in the suppression of many more signals

src/util/channel.c

index 86660368e851a94003758b43a05f6fd719e62fea..cd5cd1172d819bd920d1463ac5db420928e34121 100644 (file)
@@ -44,12 +44,6 @@ RCSID("$Id$")
  */
 #define EV_FLAG (EV_ADD | EV_CLEAR)
 
-/**
- *     Require more than this number of packets outstanding, before
- *     we start suppressing signals from the master.
- */
-#define SUPPRESS_SIGNALS_MASTER (0)
-
 /*&
  *     Whether or not to quench some signals from the worker.
  */
@@ -346,15 +340,16 @@ int fr_channel_send_request(fr_channel_t *ch, fr_channel_data_t *cd, fr_channel_
                 */
        } else if (end->num_outstanding > 1) {
                *p_reply = fr_channel_recv_reply(ch);
-       }
 
-       /*
-        *      If we got a reply, AND there are still more
-        *      outstanding packets, don't bother signaling the
-        *      worker.  It will check our queue when it sends the reply.
-        */
-       if (*p_reply && (end->num_outstanding > SUPPRESS_SIGNALS_MASTER)) {
-               return 0;
+               /*
+                *      There's no reply yet, so we still have packets outstanding.
+                *      Or, there is a reply, and there are more packets outstanding.
+                *      Skip the signal.
+                */
+               if (!*p_reply ||
+                   ((*p_reply && (end->num_outstanding > 1)))) {
+                       return 0;
+               }
        }
 
        /*