]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport the NET_TIME elimination fix.
authorColm MacCarthaigh <colm@apache.org>
Tue, 24 Jan 2006 22:45:43 +0000 (22:45 +0000)
committerColm MacCarthaigh <colm@apache.org>
Tue, 24 Jan 2006 22:45:43 +0000 (22:45 +0000)
Submitted by: wrowe

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

CHANGES
STATUS
server/core.c

diff --git a/CHANGES b/CHANGES
index c77bec26b4b39d3d50f37efc43a8d1f7c7fc966b..b3aad3fbb3a45c3315e4f73de1fb7e1c8bcb8b91 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,12 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.0.56
 
+  *) Elimiated the NET_TIME filter, restructuring the timeout logic.
+     This provides a working mod_echo on all platforms, and ensures any
+     custom protocol module is at least given an initial timeout value
+     based on the <VirtualHost > context's Timeout directive.
+     [William Rowe]  
+
   *) mod_ssl: Correct issue where mod_ssl does not pick up the 
      ssl-unclean-shutdown setting when configured. PR 34452. [Joe Orton]
 
diff --git a/STATUS b/STATUS
index 44f7cbd9750b69258581909ed430cc499872777a..be0a40c56b9679dff316277958bde2da8cf3e7bc 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -147,16 +147,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
                  as well.
          colm:   another +1 on the later patch too.
 
-    *) Fix all non-http protocol modules that were modeled after the
-       broken mod_echo.c example; remove the -initial- timeout setting
-       from NET_TIME (never inserted by non-request based protocols)
-       and move it to the core pre_connection logic, so every core
-       connection can read with timeout on Linux, Solaris, instead of
-       read (untimed) blocking on Linux, and failing read non-block on
-       Solaris.  Leaves NET_TIME intact until after the 2.0.x branch.
-         http://people.apache.org/~wrowe/httpd-2.0-proto-timeout.patch
-         +1: wrowe, colm, jim
-
     *) mod_proxy: Fix PR37145
        (data loss with httpd-2.0.55 reverse proxy method=post).
        Trunk version of patch:
index 62d7d04989ea7dcca5f1ff8aab1439f42b52af17..4fe3ce448180e800cc9029b5acc7216efd973aae 100644 (file)
@@ -3679,11 +3679,9 @@ static int net_time_filter(ap_filter_t *f, apr_bucket_brigade *b,
     }
 
     if (mode != AP_MODE_INIT && mode != AP_MODE_EATCRLF) {
-        if (ctx->first_line) {
-            apr_socket_timeout_set(ctx->csd, 
-                                   keptalive
-                                      ? f->c->base_server->keep_alive_timeout
-                                      : f->c->base_server->timeout);
+        if (keptalive && ctx->first_line) {
+            apr_socket_timeout_set(ctx->csd,
+                                   f->c->base_server->keep_alive_timeout);
             ctx->first_line = 0;
         }
         else {
@@ -4493,10 +4491,9 @@ static conn_rec *core_create_conn(apr_pool_t *ptrans, server_rec *server,
 static int core_pre_connection(conn_rec *c, void *csd)
 {
     core_net_rec *net = apr_palloc(c->pool, sizeof(*net));
-
-#ifdef AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
     apr_status_t rv;
 
+#ifdef AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
     /* BillS says perhaps this should be moved to the MPMs. Some OSes
      * allow listening socket attributes to be inherited by the
      * accept sockets which means this call only needs to be made
@@ -4518,6 +4515,20 @@ static int core_pre_connection(conn_rec *c, void *csd)
                       "apr_socket_opt_set(APR_TCP_NODELAY)");
     }
 #endif
+
+    /* The core filter requires the timeout mode to be set, which
+     * incidentally sets the socket to be nonblocking.  If this
+     * is not initialized correctly, Linux - for example - will
+     * be initially blocking, while Solaris will be non blocking
+     * and any initial read will fail.
+     */
+    rv = apr_socket_timeout_set(csd, c->base_server->timeout);
+    if (rv != APR_SUCCESS) {
+        /* expected cause is that the client disconnected already */
+        ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, c,
+                     "apr_socket_timeout_set");
+    }
+
     net->c = c;
     net->in_ctx = NULL;
     net->out_ctx = NULL;