]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
typo and clean up "stop" handling.
authorAlan T. DeKok <aland@freeradius.org>
Tue, 13 Dec 2022 14:13:29 +0000 (09:13 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 13 Dec 2022 14:21:31 +0000 (09:21 -0500)
The main unlang_interpret_stop() should take care of interpreter
issues, so the worker "stop" callbac shouldn't do that.

src/lib/io/worker.c
src/lib/unlang/interpret.c

index cf48a7b40171efa64fea2b7c8236a2621bd267c6..555fe5c7f27a943e28392fed7b42cb3e3b249c5d 100644 (file)
@@ -381,12 +381,6 @@ static void worker_stop_request(request_t **request_p)
         *      the internal/external callbacs.
         */
        unlang_interpret_signal(*request_p, FR_SIGNAL_CANCEL);
-
-       /*
-        *      Cancel just signals each frame.  We need to tell
-        *      everything else that this request is dead.
-        */
-       (*request_p)->master_state == REQUEST_STOP_PROCESSING'
        *request_p = NULL;
 }
 
@@ -1100,25 +1094,12 @@ static void _worker_request_stop(request_t *request, void *uctx)
                fr_time_tracking_resume(&request->async->tracking, fr_time());
        }
 
-       /*
-        *      Let everyone know the request is being
-        *      stopped.
-        */
-       request->master_state = REQUEST_STOP_PROCESSING;
-
        /*
         *      If the request is in the runnable queue
         *      yank it back out, so it's not "runnable"
         *      when we call request done.
         */
        if (fr_heap_entry_inserted(request->runnable_id)) fr_heap_extract(&worker->runnable, request);
-
-       /*
-        *      The interpreter doesn't currently fix
-        *      this for us, so we set the indent to 0
-        *      to avoid nasty asserts later.
-        */
-       request->log.unlang_indent = 0;
 }
 
 /** Request is now runnable
index 237cde0df6a8e059bb0306528704a1b066edc363..48de4f1c3d94cd6f79ac2f8a641327c7c1eb505f 100644 (file)
@@ -996,6 +996,7 @@ void unlang_interpret_request_stop(request_t *request)
        intp = stack->intp;
        intp->funcs.stop(request, intp->uctx);
        request->log.unlang_indent = 0;                 /* nothing unwinds the indentation stack */
+       request->master_state = REQUEST_STOP_PROCESSING;
 }
 
 static inline CC_HINT(always_inline)