Commit 8d78f8e3 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

core, modules: Avoid error response/document handling by the core if some

handler or input filter already did it while reading the request (causing
a double response body).

Submitted by: ylavic
Backports: r1482522 (partial, ap_map_http_request_error() things only!),
           r1529988, r1529991, r1643537, r1643543, r1657897, r1665625, 
           r1665721, r1674056
Reviewed by: ylavic, minfrin, wrowe




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1682544 13f79535-47bb-0310-9956-ffa450edef68
parent 2168cdd3
Loading
Loading
Loading
Loading
+7 −0
Changes for CHANGES: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -83,6 +83,13 @@ Changes with Apache 2.4.13
     will override other parameters given in the same directive. This could be
     a missing + or - prefix.  PR 52820 [Christophe Jaillet]

  *) core, modules: Avoid error response/document handling by the core if some
     handler or input filter already did it while reading the request (causing
     a double response body).  [Yann Ylavic]

  *) mod_proxy_ajp: Fix client connection errors handling and logged status
     when it occurs.  PR 56823.  [Yann Ylavic]

  *) mod_proxy: Use the correct server name for SNI in case the backend
     SSL connection itself is established via a proxy server.
     PR 57139 [Szabolcs Gyurko <szabolcs gyurko.org>]
+0 −15
Changes for STATUS: 0 added lines, 15 removed lines.
Original line number Diff line number Diff line
@@ -105,21 +105,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  *) core, modules: Avoid error response/document handling by the core if some
     handler or input filter already did it while reading the request (causing
     a double response body).
     trunk patch: http://svn.apache.org/r1482522 (partial, ap_map_http_request_error() things only!)
                  http://svn.apache.org/r1529988
                  http://svn.apache.org/r1529991
                  http://svn.apache.org/r1643537
                  http://svn.apache.org/r1643543
                  http://svn.apache.org/r1657897
                  http://svn.apache.org/r1665625
                  http://svn.apache.org/r1665721
                  http://svn.apache.org/r1674056
     2.4.x patch: http://people.apache.org/~ylavic/httpd-2.4.x-ap_map_http_request_error-v2.patch
     +1: ylavic, minfrin, wrowe


PATCHES PROPOSED TO BACKPORT FROM TRUNK:
  [ New proposals should be added at the end of the list ]
+2 −1
Changes for include/ap_mmn.h: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -442,6 +442,7 @@
 * 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()
 * 20120211.46 (2.4.13-dev) Add ap_map_http_request_error()
 */

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

/**
 * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
+17 −0
Changes for include/http_protocol.h: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -502,6 +502,23 @@ AP_DECLARE(int) ap_should_client_block(request_rec *r);
 */
AP_DECLARE(long) ap_get_client_block(request_rec *r, char *buffer, apr_size_t bufsiz);

/*
 * Map specific APR codes returned by the filter stack to HTTP error
 * codes, or the default status code provided. Use it as follows:
 *
 * return ap_map_http_request_error(rv, HTTP_BAD_REQUEST);
 *
 * If the filter has already handled the error, AP_FILTER_ERROR will
 * be returned, which is cleanly passed through.
 *
 * These mappings imply that the filter stack is reading from the
 * downstream client, the proxy will map these codes differently.
 * @param rv APR status code
 * @param status Default HTTP code should the APR code not be recognised
 * @return Mapped HTTP status code
 */
AP_DECLARE(int) ap_map_http_request_error(apr_status_t rv, int status);

/**
 * In HTTP/1.1, any method can have a body.  However, most GET handlers
 * wouldn't know what to do with a request body if they received one.
+2 −2
Changes for modules/cache/mod_file_cache.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -283,7 +283,7 @@ static int mmap_handler(request_rec *r, a_file *file)
    APR_BRIGADE_INSERT_TAIL(bb, b);

    if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS)
        return HTTP_INTERNAL_SERVER_ERROR;
        return AP_FILTER_ERROR;
#endif
    return OK;
}
@@ -301,7 +301,7 @@ static int sendfile_handler(request_rec *r, a_file *file)
    APR_BRIGADE_INSERT_TAIL(bb, b);

    if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS)
        return HTTP_INTERNAL_SERVER_ERROR;
        return AP_FILTER_ERROR;
#endif
    return OK;
}
Loading