From: Alan T. DeKok Date: Fri, 27 Aug 2021 14:57:40 +0000 (-0400) Subject: order requests by sequence number, too X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a75e959b8cd5b3bc78d5324cb1013a1bcfaf7147;p=thirdparty%2Ffreeradius-server.git order requests by sequence number, too --- diff --git a/src/lib/io/listen.h b/src/lib/io/listen.h index ed98640957f..d1d42ef955d 100644 --- a/src/lib/io/listen.h +++ b/src/lib/io/listen.h @@ -62,6 +62,8 @@ struct fr_async_s { fr_listen_t *listen; //!< How we received this request, //!< and how we'll send the reply. uint32_t priority; //!< higher == higher priority + + uint32_t sequence; //!< higher == higher priority, too }; int fr_io_listen_free(fr_listen_t *li); diff --git a/src/lib/io/worker.c b/src/lib/io/worker.c index e063a036610..806824ca0cf 100644 --- a/src/lib/io/worker.c +++ b/src/lib/io/worker.c @@ -829,6 +829,9 @@ static int8_t worker_runnable_cmp(void const *one, void const *two) ret = CMP(a->async->priority, b->async->priority); if (ret != 0) return ret; + ret = CMP(a->async->sequence, b->async->sequence); + if (ret != 0) return ret; + return CMP(a->async->recv_time, b->async->recv_time); }