Improve 'socket timeout reached' message
authorFabian Keil <fk@fabiankeil.de>
Mon, 26 Jun 2017 12:14:25 +0000 (12:14 +0000)
committerFabian Keil <fk@fabiankeil.de>
Mon, 26 Jun 2017 12:14:25 +0000 (12:14 +0000)
Log the timeout that was triggered and downgrade the
log level to LOG_LEVEL_CONNECT to reduce the log noise
with common debug settings.

The timeout isn't necessary the result of an error and
usually merely indicates that Privoxy's socket timeout
is lower than the relevant timeouts used by client and
server.

Sponsored by: Robert Klemme

jcc.c

diff --git a/jcc.c b/jcc.c
index 1026672..3bb2801 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.463 2017/06/26 12:12:55 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.464 2017/06/26 12:13:52 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -2116,8 +2116,8 @@ static void handle_established_connection(struct client_state *csp,
 
       if (n == 0)
       {
-         log_error(LOG_LEVEL_ERROR,
-            "Didn't receive data in time: %s", http->url);
+         log_error(LOG_LEVEL_CONNECT, "Socket timeout %d reached: %s",
+            csp->config->socket_timeout, http->url);
          if ((byte_count == 0) && (http->ssl == 0))
          {
             send_crunch_response(csp, error_response(csp, "connection-timeout"));