]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Correct sort sequence for requests in runnable heap
authorNick Porter <nick@portercomputing.co.uk>
Fri, 12 Jul 2024 08:32:25 +0000 (09:32 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 12 Jul 2024 08:33:06 +0000 (09:33 +0100)
src/lib/io/worker.c

index 3630b2575e848963d9480a32d8c0adf0fe1a307e..eadb77c5c36479ee4283ee4647cc92cde9ff0736 100644 (file)
@@ -957,13 +957,14 @@ nak:
 
 /**
  *  Track a request_t in the "runnable" heap.
+ *  Higher priorities take precedence, followed by lower sequence numbers
  */
 static int8_t worker_runnable_cmp(void const *one, void const *two)
 {
        request_t const *a = one, *b = two;
        int ret;
 
-       ret = CMP(a->async->priority, b->async->priority);
+       ret = CMP(b->async->priority, a->async->priority);
        if (ret != 0) return ret;
 
        ret = CMP(a->async->sequence, b->async->sequence);