From adea9cbfa554661b27ad6f3ad6bbc3184bd03099 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Mon, 7 Dec 2015 12:17:35 +0000 Subject: [PATCH] Merge r1717063 from trunk: Fix the use of the default 'flush' provider. Improve documentation for the "flusher" parameter. Remove useless empty lines. See http://mail-archives.apache.org/mod_mbox/httpd-dev/200812.mbox/%3C494226C0.4050407@force-elite.com%3E for some more explanation. A python script is given there to test. I had to tweak it to have it work (use: fd, payload = passfd.recvfd(conn.fileno()) instead of: fd = passfd.recvfd(conn.fileno()) ) This is a r1058621 regression, where somehow "char *flusher" has been turned into a "char flusher[]". So it is been broken since the beginning of 2.4.x After this change (i.e. r1058621), 'flusher' is no more a pointer (NULL'ed when the structure it belongs to is created) but the address of an array within a structure. It can not be NULL anymore. So, we now have to look at the content of the array itself to see if it has been initialized or if we have to use the default value instead. Submitted by: jailletc36 Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1718324 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 6 ++++++ STATUS | 5 ----- docs/manual/mod/mod_proxy.xml | 5 +++++ docs/manual/mod/mod_proxy_fdpass.xml | 11 ++++++++--- modules/proxy/mod_proxy_fdpass.c | 6 +----- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index e3e2b2ed4d..5d67550a3c 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,12 @@ Changes with Apache 2.4.18 *) mod_http2: required minimum version of libnghttp2 is 1.2.1 [Stefan Eissing] + *) mod_proxy_fdpass: Fix AH01153 error when using the default configuration. + In earlier version of httpd, you can explicitelly set the 'flusher' parameter + to 'flush' as a workaround. (i.e. flusher=flush) + Add documentation for the 'flusher' parameter when defining a proxy worker. + [Christophe Jaillet] + *) mod_ssl: For the "SSLStaplingReturnResponderErrors off" case, make sure to only staple responses with certificate status "good". [Kaspar Brand] diff --git a/STATUS b/STATUS index cd2e4e4f12..1998f3e0ab 100644 --- a/STATUS +++ b/STATUS @@ -111,11 +111,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - *) mod_proxy_fdpass: Fix this module which has been broken since the beginning - of 2.4.x. More details in the change entry of r1717063 - trunk patch: http://svn.apache.org/r1717063 - 2.4.x patch: trunk patch works (module CHANGES) - +1: jailletc36, wrowe, ylavic PATCHES PROPOSED TO BACKPORT FROM TRUNK: diff --git a/docs/manual/mod/mod_proxy.xml b/docs/manual/mod/mod_proxy.xml index e4cdd50c1d..7aae8190fe 100644 --- a/docs/manual/mod/mod_proxy.xml +++ b/docs/manual/mod/mod_proxy.xml @@ -1162,6 +1162,11 @@ ProxyPass "/mirror/foo" "http://backend.example.com" connection will not be used again; it will be closed at some later time. + flusher + flush +

Name of the provider used by mod_proxy_fdpass. + See the documentation of this module for more details.

+ diff --git a/docs/manual/mod/mod_proxy_fdpass.xml b/docs/manual/mod/mod_proxy_fdpass.xml index 5d61836d79..745ad142cb 100644 --- a/docs/manual/mod/mod_proxy_fdpass.xml +++ b/docs/manual/mod/mod_proxy_fdpass.xml @@ -42,9 +42,14 @@

The module has a proxy_fdpass_flusher provider interface, which allows another module to optionally send the response headers, or even - the start of the response body. The default flush provider disables keep-alive, - and sends the response headers, letting the external process just send a - response body.

+ the start of the response body. The default flush provider + disables keep-alive, and sends the response headers, letting the external + process just send a response body. +

+ +

In order to use another provider, you have to set the flusher + parameter in the ProxyPass directive. +

At this time the only data passed to the external process is the client socket. To receive a client socket, call recvfrom with an allocated diff --git a/modules/proxy/mod_proxy_fdpass.c b/modules/proxy/mod_proxy_fdpass.c index 63cf469664..195b0fdb6c 100644 --- a/modules/proxy/mod_proxy_fdpass.c +++ b/modules/proxy/mod_proxy_fdpass.c @@ -57,7 +57,6 @@ static apr_status_t get_socket_from_path(apr_pool_t *p, *out_sock = NULL; rv = apr_socket_create(&s, AF_UNIX, SOCK_STREAM, 0, p); - if (rv != APR_SUCCESS) { return rv; } @@ -72,7 +71,6 @@ static apr_status_t get_socket_from_path(apr_pool_t *p, return APR_SUCCESS; } - static apr_status_t send_socket(apr_pool_t *p, apr_socket_t *s, apr_socket_t *outbound) @@ -119,7 +117,6 @@ static apr_status_t send_socket(apr_pool_t *p, return errno; } - return APR_SUCCESS; } @@ -149,7 +146,7 @@ static int proxy_fdpass_handler(request_rec *r, proxy_worker *worker, { int status; - const char *flush_method = worker->s->flusher ? worker->s->flusher : "flush"; + const char *flush_method = *worker->s->flusher ? worker->s->flusher : "flush"; proxy_fdpass_flush *flush = ap_lookup_provider(PROXY_FDPASS_FLUSHER, flush_method, "0"); @@ -191,7 +188,6 @@ static int proxy_fdpass_handler(request_rec *r, proxy_worker *worker, ap_set_core_module_config(r->connection->conn_config, dummy); } - return OK; } -- 2.40.0