diff options
author | Yann Ylavic <ylavic@apache.org> | 2016-12-23 00:30:05 +0100 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2016-12-23 00:30:05 +0100 |
commit | 0674872c164c247407ed2c9a29cade1722168e09 (patch) | |
tree | f4edcc3d90f9554bc8aacae990de03881bfe8705 /modules | |
parent | pass along error buckets (diff) | |
download | apache2-0674872c164c247407ed2c9a29cade1722168e09.tar.xz apache2-0674872c164c247407ed2c9a29cade1722168e09.zip |
mod_proxy_{ajp,fcgi}: Fix a possible crash when reusing an established
backend connection, happening with LogLevel trace2 or higher configured,
or at any log level with compilers not detected as C99 compliant (e.g.
MSVC on Windows).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1775775 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r-- | modules/proxy/proxy_util.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 8aec33337d..1f439c7588 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -2754,10 +2754,13 @@ PROXY_DECLARE(apr_status_t) ap_proxy_check_connection(const char *scheme, } if (rv == APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_TRACE2, 0, server, - "%s: reusing backend connection %pI<>%pI", - scheme, conn->connection->local_addr, - conn->connection->client_addr); + if (APLOGtrace2(server)) { + apr_sockaddr_t *local_addr = NULL; + apr_socket_addr_get(&local_addr, APR_LOCAL, conn->sock); + ap_log_error(APLOG_MARK, APLOG_TRACE2, 0, server, + "%s: reusing backend connection %pI<>%pI", + scheme, local_addr, conn->addr); + } } else if (conn->sock) { /* This clears conn->scpool (and associated data), so backup and |