]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r562510 from trunk:
authorRuediger Pluem <rpluem@apache.org>
Mon, 3 Sep 2007 20:56:14 +0000 (20:56 +0000)
committerRuediger Pluem <rpluem@apache.org>
Mon, 3 Sep 2007 20:56:14 +0000 (20:56 +0000)
  *) mod_proxy: Improve network performance by setting APR_TCP_NODELAY
     (disable Nagle algorithm) on sockets if implemented.
     PR 42871 [Christian BOITEL <christian_boitel yahoo.fr>, Jim Jagielski]

Submitted by: Christian BOITEL <christian_boitel yahoo.fr>, jim
Reviewed by: rpluem, jim, fielding

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

CHANGES
STATUS
modules/proxy/mod_proxy_ftp.c
modules/proxy/proxy_util.c

diff --git a/CHANGES b/CHANGES
index fa875848cb12b362978654bb2723a5157aa1ad57..8116c3f6af4708063b179eb1e90f5964c17193d3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.6
 
+  *) mod_proxy: Improve network performance by setting APR_TCP_NODELAY
+     (disable Nagle algorithm) on sockets if implemented.
+     PR 42871 [Christian BOITEL <christian_boitel yahoo.fr>, Jim Jagielski]
+
   *) core: Do not replace a Date header set by a proxied backend server.
      PR 40232. [Ruediger Pluem]
 
diff --git a/STATUS b/STATUS
index e9d6407cc0f36ac994c00696439936719e2f826d..1c0b850a146f6c7bd5719de7f5500d33b8c8be9f 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -79,14 +79,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-    * mod_proxy: Improve network performance by setting APR_TCP_NODELAY
-     (disable Nagle algorithm) on sockets if implemented. PR 42871.
-      Trunk version of patch:
-         http://svn.apache.org/viewcvs.cgi?rev=562510&view=rev
-      Backport version for 2.2.x of patch:
-         Trunk version of patch works
-      +1: rpluem, jim, fielding
-
     * mod_proxy: Ensure that at least scheme://hostname[:port] matches
       between worker and URL when trying to find the worker that fits best to
       the given URL. PR 40910.
index 03cb0953de23bcafa40a18a2c1b7d3f8f4c33c63..eac6eff62975f6a738c504bd06d6741a1e3dc88b 100644 (file)
@@ -1233,6 +1233,12 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker,
                 }
 #endif
 
+                rv = apr_socket_opt_set(data_sock, APR_TCP_NODELAY, 1);
+                if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) {
+                    ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+                                 "apr_socket_opt_set(APR_TCP_NODELAY): Failed to set");
+                }
+
                 /* make the connection */
                 apr_socket_addr_get(&data_addr, APR_REMOTE, sock);
                 apr_sockaddr_ip_get(&data_ip, data_addr);
@@ -1321,6 +1327,12 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker,
                 }
 #endif
 
+                rv = apr_socket_opt_set(data_sock, APR_TCP_NODELAY, 1);
+                if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) {
+                    ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+                                 "apr_socket_opt_set(APR_TCP_NODELAY): Failed to set");
+                }
+
                 /* make the connection */
                 apr_sockaddr_info_get(&pasv_addr, apr_psprintf(p, "%d.%d.%d.%d", h3, h2, h1, h0), connect_addr->family, pasvport, 0, p);
                 rv = apr_socket_connect(data_sock, pasv_addr);
index a7880af4776c4cea1921b120f94acb24dec99677..30a5e49ab987a82790c51514e31ab7abf74027a1 100644 (file)
@@ -1498,6 +1498,13 @@ PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **newsock,
         }
 #endif
 
+        rv = apr_socket_opt_set(*newsock, APR_TCP_NODELAY, 1);
+        if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) {
+             ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
+                          "apr_socket_opt_set(APR_TCP_NODELAY): "
+                          "Failed to set");
+        }
+
         /* Set a timeout on the socket */
         if (conf->timeout_set == 1) {
             apr_socket_timeout_set(*newsock, conf->timeout);
@@ -2127,6 +2134,13 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
         }
 #endif
 
+        rv = apr_socket_opt_set(newsock, APR_TCP_NODELAY, 1);
+        if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) {
+             ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
+                          "apr_socket_opt_set(APR_TCP_NODELAY): "
+                          "Failed to set");
+        }
+
         /* Set a timeout on the socket */
         if (worker->timeout_set == 1) {
             apr_socket_timeout_set(newsock, worker->timeout);