From: Alan T. DeKok Date: Wed, 14 Dec 2016 19:52:23 +0000 (-0500) Subject: resumable requests have priority over runnable ones. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1b7c4f4c77e698bcd88380ccbb50f5eaade1090;p=thirdparty%2Ffreeradius-server.git resumable requests have priority over runnable ones. And don't insert them back into the runnable list. --- diff --git a/src/util/worker.c b/src/util/worker.c index cd0e1bc24dc..fd2e54d46a2 100644 --- a/src/util/worker.c +++ b/src/util/worker.c @@ -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; } /*