]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
resumable requests have priority over runnable ones.
authorAlan T. DeKok <aland@freeradius.org>
Wed, 14 Dec 2016 19:52:23 +0000 (14:52 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 14 Dec 2016 19:52:23 +0000 (14:52 -0500)
And don't insert them back into the runnable list.

src/util/worker.c

index cd0e1bc24dcb9aada6f028027e30cf465aa95b9d..fd2e54d46a201087cdb8a7b4213ffcc57ebb05e4 100644 (file)
@@ -408,18 +408,14 @@ static REQUEST *fr_worker_get_request(fr_worker_t *worker, fr_time_t now)
 
        /*
         *      The resumable list is updated asychronously in the IO
-        *      and timer handlers.  We have to pull the requests out
-        *      of the resumable list, and insert them into the
-        *      runnable list.
+        *      and timer handlers.  Resumable requests have a higher
+        *      priority than runnable requests.
         */
        entry = FR_DLIST_FIRST(worker->resumable);
-       while (entry != NULL) {
-               fr_dlist_t *next;
-
-               next = FR_DLIST_NEXT(worker->resumable, entry);
-
+       if (entry) {
                request = fr_ptr_to_type(REQUEST, list, entry);
-               WORKER_HEAP_INSERT(runnable, request, list);
+               FR_DLIST_REMOVE(request->list);
+               return request;
        }
 
        /*