]> granicus.if.org Git - apache/commitdiff
*) server/mpm_common.c: Send a simple HTTP 1.0 request to every listener socket,...
authorPaul Querna <pquerna@apache.org>
Mon, 27 Jun 2005 18:40:56 +0000 (18:40 +0000)
committerPaul Querna <pquerna@apache.org>
Mon, 27 Jun 2005 18:40:56 +0000 (18:40 +0000)
In the future, we need a method to send a simple request for all protocols.  Currently this is very specific to HTTP and FreeBSD's Accept Filter.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@202027 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/mpm_common.c

diff --git a/CHANGES b/CHANGES
index 57082f25a7000f16f9ad328f012853bcca41523d..0e1cdd60d85f7e74a6878738eabbb976a4bba2e5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
 Changes with Apache 2.1.7
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) Fix shutdown for the Worker MPM when an Accept Filter is used. Instead of 
+     just closing the socket, a HTTP request is made, to make sure the child is 
+     always awakened. [Paul Querna]
+
 Changes with Apache 2.1.6
 
   *) Fix htdbm password validation for records which included comments.
index 619e53892fd4c558e896ceecdd290de70652f556..9238f2ebb69bb6a83131e8d378f666c5098098fc 100644 (file)
@@ -546,6 +546,7 @@ static apr_status_t pod_signal_internal(ap_pod_t *pod)
  */
 static apr_status_t dummy_connection(ap_pod_t *pod)
 {
+    const char* srequest = "GET / HTTP/1.0\r\n\r\n";
     apr_status_t rv;
     apr_socket_t *sock;
     apr_pool_t *p;
@@ -596,6 +597,16 @@ static apr_status_t dummy_connection(ap_pod_t *pod)
                      "connect to listener on %pI", ap_listeners->bind_addr);
     }
 
+    /* Since some operating systems support buffering of data or entire 
+     * requests in the kernel, we send a simple request, to make sure 
+     * the server pops out of a blocking accept(). 
+     */
+    /* XXX: This is HTTP specific. We should look at the Protocol for each 
+     * listener, and send the correct type of request to trigger any Accept
+     * Filters.
+     */
+    apr_socket_send(sock, srequest, strlen(srequest));
+    apr_socket_shutdown(sock, APR_SHUTDOWN_WRITE);
     apr_socket_close(sock);
     apr_pool_destroy(p);