]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
return "no more data" when too many outstanding packets.
authorAlan T. DeKok <aland@freeradius.org>
Wed, 17 Jan 2018 14:53:01 +0000 (09:53 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 17 Jan 2018 14:53:01 +0000 (09:53 -0500)
Once a socket is ready, the network side tries to read many
packets.  So we have to check for max_outstanding ourselves

src/modules/proto_detail/proto_detail_work.c

index 8f6bdd41867db3a9b80615ff9f9f1857ec40519b..c06e3885a61a613d27e972d3885643b6d5800138 100644 (file)
@@ -165,6 +165,16 @@ static ssize_t mod_read(void *instance, void **packet_ctx, fr_time_t **recv_time
                return 0;
        }
 
+       /*
+        *      Once a socket is ready, the network side tries to read
+        *      many packets.  So if we want to stop it from reading,
+        *      we have to check this ourselves.
+        */
+       if (inst->outstanding >= inst->max_outstanding) {
+               rad_assert(inst->paused);
+               return 0;
+       }
+
        /*
         *      Seek to the current read offset.
         */