From: Fabian Keil Date: Fri, 18 Sep 2009 18:57:20 +0000 (+0000) Subject: Don't bother remembering connections that already timed out. X-Git-Tag: v_3_0_15~53 X-Git-Url: http://www.privoxy.org/gitweb/%40%40?a=commitdiff_plain;h=2d3c45aab07ab1c1b0717e2c8a61d2ff144554ad;p=privoxy.git Don't bother remembering connections that already timed out. While remembering them is safe as they wouldn't be reused anyway, it's pointless, causes log noise and temporarily blocks a socket slot. --- diff --git a/jcc.c b/jcc.c index 9795626d..12dc1db1 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.292 2009/09/12 12:37:37 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.293 2009/09/18 18:52:33 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -2555,6 +2555,13 @@ static void serve(struct client_state *csp) if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_SHARING) && (socket_is_still_usable(csp->sfd))) { + time_t time_open = time(NULL) - csp->server_connection.timestamp; + + if (csp->server_connection.keep_alive_timeout < time_open + latency) + { + break; + } + remember_connection(csp, forward_url(csp, csp->http)); csp->sfd = JB_INVALID_SOCKET; close_socket(csp->cfd);