From: Alan T. DeKok Date: Wed, 17 Jan 2018 14:53:01 +0000 (-0500) Subject: return "no more data" when too many outstanding packets. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26e552131f44755dcef089ff91ba00cb306e91bd;p=thirdparty%2Ffreeradius-server.git return "no more data" when too many outstanding packets. Once a socket is ready, the network side tries to read many packets. So we have to check for max_outstanding ourselves --- diff --git a/src/modules/proto_detail/proto_detail_work.c b/src/modules/proto_detail/proto_detail_work.c index 8f6bdd41867..c06e3885a61 100644 --- a/src/modules/proto_detail/proto_detail_work.c +++ b/src/modules/proto_detail/proto_detail_work.c @@ -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. */