From 71b5c53a0a77e6f9d1b5730a3b025b9c00016a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Sun, 5 Jul 2015 16:48:27 +0000 Subject: [PATCH] show extforward re-run warning only with debug.log-request-handling (fixes #2561) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Stefan Bühler git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2993 152afb58-edef-0310-8abb-c4023f1b3aa9 --- NEWS | 1 + src/mod_extforward.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 5a8d6f77..51cf5eee 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,7 @@ NEWS * fix segfaults in many plugins if they failed configuration * escape all strings for logging (fixes #2646 log file injection, reported by Jaanus Kääp) * fix hex escape in accesslog (fixes #2559) + * show extforward re-run warning only with debug.log-request-handling (fixes #2561) - 1.4.35 - 2014-03-12 * [network/ssl] fix build error if TLSEXT is disabled diff --git a/src/mod_extforward.c b/src/mod_extforward.c index 557c5051..25dde926 100644 --- a/src/mod_extforward.c +++ b/src/mod_extforward.c @@ -445,8 +445,10 @@ URIHANDLER_FUNC(mod_extforward_uri_handler) { if (sock.plain.sa_family != AF_UNSPEC) { /* we found the remote address, modify current connection and save the old address */ if (con->plugin_ctx[p->id]) { - log_error_write(srv, __FILE__, __LINE__, "s", - "patching an already patched connection!"); + if (con->conf.log_request_handling) { + log_error_write(srv, __FILE__, __LINE__, "s", + "-- mod_extforward_uri_handler already patched this connection, resetting state"); + } handler_ctx_free(con->plugin_ctx[p->id]); con->plugin_ctx[p->id] = NULL; } @@ -456,7 +458,7 @@ URIHANDLER_FUNC(mod_extforward_uri_handler) { con->dst_addr = sock; con->dst_addr_buf = buffer_init(); buffer_copy_string(con->dst_addr_buf, real_remote_addr); - + if (con->conf.log_request_handling) { log_error_write(srv, __FILE__, __LINE__, "ss", "patching con->dst_addr_buf for the accesslog:", real_remote_addr);