]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Win32: Do not continue to handle keepalive requests if the server process
authorBill Stoddard <stoddard@apache.org>
Mon, 26 Nov 2001 17:26:54 +0000 (17:26 +0000)
committerBill Stoddard <stoddard@apache.org>
Mon, 26 Nov 2001 17:26:54 +0000 (17:26 +0000)
is in the process of shutting down.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@92179 13f79535-47bb-0310-9956-ffa450edef68

src/CHANGES
src/main/http_main.c

index 215de8bb5f3ed79248a43aae148fcb5d786f9920..8aaa729066d2abde7419f5c479694d04a2474ced 100644 (file)
@@ -1,9 +1,10 @@
-Changes with Apache 1.3.24
+Changes with Apache 1.3.23
+  *) Win32: Do not allow threads to continue handling keepalive
+     requests after a shutdown or restart has ben signaled.
+     [Bill Stoddard]
 
   *) Win32: Accept OPTIONS * requests.  [Keith Wannamaker]
 
-Changes with Apache 1.3.23
-
   *) Unixware 7.0 and later did not have a default locking
      mechanism defined.  This bug was introduced in apache 1.3.4.
      [Dean Gaudet]
index 3d859b08ff34da18b0506637e72e8a8bfc0ac6bd..6dd94de16fe3286d0650d25db8ca3f850083b810 100644 (file)
@@ -5839,7 +5839,14 @@ static void child_sub_main(int child_num)
                increment_counts(child_num, r);
            if (!current_conn->keepalive || current_conn->aborted)
                break;
-
+            /* If the server is shutting down, do not allow anymore requests 
+             * to be handled on the keepalive connection. Leave the thread 
+             * alive to drain the job queue. This check is particularly 
+             * important on the threaded server to allow the process to be 
+             * quickly taken down cleanly.
+             */
+            if (allowed_globals.exit_now)
+                break;
            ap_destroy_pool(r->pool);
            (void) ap_update_child_status(child_num, SERVER_BUSY_KEEPALIVE,
                                       (request_rec *) NULL);
@@ -6203,7 +6210,7 @@ void worker_main(void)
             add_job(csd);
         }
     }
-      
+
     APD2("process PID %d exiting", my_pid);
 
     /* Get ready to shutdown and exit */
@@ -6421,7 +6428,7 @@ void worker_main(void)
            total_jobs++;
        }
     }
-      
+
     APD2("process PID %d exiting", my_pid);
 
     /* Get ready to shutdown and exit */