httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r924455 - /httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
Date Wed, 17 Mar 2010 20:08:42 GMT
Author: sf
Date: Wed Mar 17 20:08:42 2010
New Revision: 924455

URL: http://svn.apache.org/viewvc?rev=924455&view=rev
Log:
If the client disconnects and the backend continues to send data fast, forcibly
close the backend connection.

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c?rev=924455&r1=924454&r2=924455&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_connect.c Wed Mar 17 20:08:42 2010
@@ -135,6 +135,8 @@ static int proxy_connect_transfer(reques
         rv = ap_get_brigade(c_i->input_filters, bb, AP_MODE_READBYTES,
                             APR_NONBLOCK_READ, CONN_BLKSZ);
         if (rv == APR_SUCCESS) {
+            if (c_o->aborted)
+                return APR_EPIPE;
             if (APR_BRIGADE_EMPTY(bb))
                 break;
 #ifdef DEBUGGING
@@ -186,6 +188,7 @@ static int proxy_connect_handler(request
     char buffer[HUGE_STRING_LEN];
     apr_socket_t *client_socket = ap_get_module_config(c->conn_config, &core_module);
     int failed, rc;
+    int client_error = 0;
     apr_pollset_t *pollset;
     apr_pollfd_t pollfd;
     const apr_pollfd_t *signalled;
@@ -440,6 +443,8 @@ static int proxy_connect_handler(request
                          ap_log_rerror(APLOG_MARK, APLOG_NOTICE, 0, r,
                                        "proxy: CONNECT: err/hup on backconn");
                 }
+                if (rv != APR_SUCCESS)
+                    client_error = 1;
             }
             else if (cur->desc.s == client_socket) {
                 pollevent = cur->rtnevents;
@@ -472,7 +477,10 @@ static int proxy_connect_handler(request
      * Close the socket and clean up
      */
 
-    ap_lingering_close(backconn);
+    if (client_error)
+        apr_socket_close(sock);
+    else
+        ap_lingering_close(backconn);
 
     c->aborted = 1;
 



Mime
View raw message