]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove "runnable" requests from the runnable queue
authorAlan T. DeKok <aland@freeradius.org>
Thu, 19 Oct 2017 14:57:24 +0000 (10:57 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 19 Oct 2017 14:57:24 +0000 (10:57 -0400)
src/main/unlang_interpret.c

index 68386180230c27c455268722807173e2241096a7..e79114cfcafa49060914031410e75c9ea367cfac 100644 (file)
@@ -1121,13 +1121,21 @@ static rlm_rcode_t unlang_parallel_run(REQUEST *request, unlang_parallel_t *stat
         *      return, no one can access their data any more.
         */
        for (i = 0; i < state->num_children; i++) {
-               if ((state->children[i].state == CHILD_YIELDED) ||
-                   (state->children[i].state == CHILD_RUNNABLE)) {
+               switch (state->children[i].state) {
+               case CHILD_RUNNABLE:
+                       (void) fr_heap_extract(state->children[i].child->backlog,
+                                              state->children[i].child);
+                       /* FALL-THROUGH */
+
+               case CHILD_YIELDED:
                        TALLOC_FREE(state->children[i].child);
-               }
+                       /* FALL-THROUGH */
 
-               state->children[i].state = CHILD_DONE;
-               state->children[i].instruction = NULL;
+               default:
+                       state->children[i].state = CHILD_DONE;
+                       state->children[i].instruction = NULL;
+                       break;
+               }
        }
 
        /*