Commit d9be8fe2 authored by Jeff Trawick's avatar Jeff Trawick
Browse files

mod_proxy_http: Use the "Connection: close" header for requests to

backends not recycling connections (disablereuse), including the default
reverse and forward proxies.

Submitted by: ylavic (and trawick for an old helper function)
Reviewed by: rjung, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1673896 13f79535-47bb-0310-9956-ffa450edef68
parent 6a67ad70
Loading
Loading
Loading
Loading
+7 −0
Changes for CHANGES: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -12,6 +12,13 @@ Changes with Apache 2.4.13
     calls r:wsupgrade() can cause a child process crash. 
     [Edward Lu <Chaosed0 gmail.com>]

  *) mod_proxy_http: Use the "Connection: close" header for requests to
     backends not recycling connections (disablereuse), including the default
     reverse and forward proxies.  [Yann Ylavic]

  *) mod_proxy: Add ap_connection_reusable() for checking if a connection
     is reusable as of this point in processing.  [Jeff Trawick]

  *) core_filters: restore/disable TCP_NOPUSH option after non-blocking
     sendfile.  [Yann Ylavic]

+0 −8
Changes for STATUS: 0 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -105,14 +105,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  *) mod_proxy_http: Use the "Connection: close" header for requests to
     backends not recycling connections (disablereuse), including the default
     reverse and forward proxies.
     trunk patch: http://svn.apache.org/r1526189
                  http://svn.apache.org/r1658765
     2.4.x patch: http://people.apache.org/~ylavic/httpd-2.4.x-ap_proxy_connection_reusable.patch
     +1: ylavic, rjung, covener

  *) mod_ssl: Protect ENGINE_CTRL_CHIL_SET_FORKCHECK macro with a 
     featue check for libressl. 
     trunk patch: http://svn.apache.org/r1673455
+2 −1
Changes for include/ap_mmn.h: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -441,6 +441,7 @@
 * 20120211.43 (2.4.13-dev) Add keep_alive_timeout_set to server_rec
 * 20120211.44 (2.4.13-dev) Add cgi_pass_auth and AP_CGI_PASS_AUTH_* to 
 *                          core_dir_config
 * 20120211.45 (2.4.13-dev) Add ap_proxy_connection_reusable()
 */

#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
@@ -448,7 +449,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20120211
#endif
#define MODULE_MAGIC_NUMBER_MINOR 44                   /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 45                   /* 0...n */

/**
 * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+11 −0
Changes for modules/proxy/mod_proxy.h: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -889,6 +889,17 @@ PROXY_DECLARE(apr_status_t) ap_proxy_connect_uds(apr_socket_t *sock,
PROXY_DECLARE(int) ap_proxy_connection_create(const char *proxy_function,
                                              proxy_conn_rec *conn,
                                              conn_rec *c, server_rec *s);

/**
 * Determine if proxy connection can potentially be reused at the
 * end of this request.
 * @param conn proxy connection
 * @return non-zero if reusable, 0 otherwise
 * @note Even if this function returns non-zero, the connection may
 * be subsequently marked for closure.
 */
PROXY_DECLARE(int) ap_proxy_connection_reusable(proxy_conn_rec *conn);

/**
 * Signal the upstream chain that the connection to the backend broke in the
 * middle of the response. This is done by sending an error bucket with
+3 −1
Changes for modules/proxy/mod_proxy_fcgi.c: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -225,7 +225,9 @@ static apr_status_t send_begin_request(proxy_conn_rec *conn,
    ap_fcgi_fill_in_header(&header, AP_FCGI_BEGIN_REQUEST, request_id,
                           sizeof(abrb), 0);

    ap_fcgi_fill_in_request_body(&brb, AP_FCGI_RESPONDER, AP_FCGI_KEEP_CONN);
    ap_fcgi_fill_in_request_body(&brb, AP_FCGI_RESPONDER,
                                 ap_proxy_connection_reusable(conn)
                                     ? AP_FCGI_KEEP_CONN : 0);

    ap_fcgi_header_to_array(&header, farray);
    ap_fcgi_begin_request_body_to_array(&brb, abrb);
Loading