]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Turn assert into run-time check
authorAlan T. DeKok <aland@freeradius.org>
Fri, 4 Nov 2011 11:54:52 +0000 (12:54 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 4 Nov 2011 11:55:25 +0000 (12:55 +0100)
src/main/process.c

index a5dceef811e92ff9a9d97629c20e8021dfe2b0d7..32149119b8ecd6fc14c9dcbcd0703c5dceae772d 100644 (file)
@@ -429,11 +429,18 @@ static void request_done(REQUEST *request, int action)
                 *      under us.
                 */
        case FR_ACTION_DONE:
+#ifdef HAVE_PTHREAD_H
+               /*
+                *      If we have child threads and we're NOT the
+                *      thread handling the request, don't do anything.
+                */
+               if (spawn_flag &&
+                   !pthread_equal(pthread_self(), request->child_pid)) {
+                       break;
+               }
+#endif
 #ifdef DEBUG_STATE_MACHINE
                if (debug_flag) printf("(%u) ********\tSTATE %s C%u -> C%u\t********\n", request->number, __FUNCTION__, request->child_state, REQUEST_DONE);
-#endif
-#ifdef HAVE_PTHREAD_H
-               rad_assert(request->child_pid == NO_SUCH_CHILD_PID);
 #endif
                request->child_state = REQUEST_DONE;
                break;