Commit 25970d35 authored by Yann Ylavic's avatar Yann Ylavic
Browse files

Merge r1526189, r1658765 from trunk.


r1526189 | trawick | 2013-09-25 16:29:02 +0200 (Wed, 25 Sep 2013) | 8 lines

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

mod_proxy_fcgi uses the new API to determine if FCGI_CONN_CLOSE
should be enabled, but that doesn't change existing behavior
since the connection is currently marked for closure elsewhere
in the module.


r1658765 | ylavic | 2015-02-10 18:25:54 +0100 (Tue, 10 Feb 2015) | 4 lines

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


Reviewed by: ylavic, wrowe, rjung
Backported by: ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1680923 13f79535-47bb-0310-9956-ffa450edef68
parent ed528b88
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
                                                         -*- coding: utf-8 -*-
Changes with Apache 2.2.30

  *) 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]

  *) mod_proxy: Reuse proxy/balancer workers' parameters and scores across
     graceful restarts, even if new workers are added, old ones removed, or
     the order changes.  [Jan Kaluza, Yann Ylavic]
+0 −9
Original line number Diff line number Diff line
@@ -118,15 +118,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
             vulnerable per se (no ErrorDocument handling from early
             request line parser), better be safe than sorry.

   * 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: merged in http://svn.apache.org/r1673896
     2.2.x patch: http://people.apache.org/~ylavic/httpd-2.2.x-ap_proxy_connection_reusable.patch
     +1: ylavic, wrowe, rjung


PATCHES PROPOSED TO BACKPORT FROM TRUNK:
  [ New proposals should be added at the end of the list ]
+2 −1
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@
 * 20051115.36 (2.2.28) Add r->trailers_{in,out}
 * 20051115.37 (2.2.30) Add ap_get_server_name_for_url()
 * 20051115.38 (2.2.30) Add ap_proxy_set_scoreboard_lb() in mod_proxy.h
 * 20051115.39 (2.2.30) Add ap_proxy_connection_reusable()
 */

#define MODULE_MAGIC_COOKIE 0x41503232UL /* "AP22" */
@@ -163,7 +164,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20051115
#endif
#define MODULE_MAGIC_NUMBER_MINOR 38                    /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 39                    /* 0...n */

/**
 * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+11 −0
Original line number Diff line number Diff line
@@ -742,6 +742,17 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
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
+1 −1
Original line number Diff line number Diff line
@@ -1122,7 +1122,7 @@ skip_body:
     * otherwise sent Connection: Keep-Alive.
     */
    if (!force10) {
        if (p_conn->close || p_conn->close_on_recycle) {
        if (!ap_proxy_connection_reusable(p_conn)) {
            buf = apr_pstrdup(p, "Connection: close" CRLF);
        }
        else {
Loading