X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=gateway.c;h=2d3a4913535fee7a6072586730d9fca8cb81925a;hb=02bcc6702ee7fe694001deb8b81c4c6fff177c9e;hp=77ff47aa2ce3eb65b21c4c40b523e3b2f3bbdbca;hpb=c453a6c5675a72d33d7d2e1f499ee6f3a1c2ab02;p=privoxy.git diff --git a/gateway.c b/gateway.c index 77ff47aa..2d3a4913 100644 --- a/gateway.c +++ b/gateway.c @@ -1,4 +1,4 @@ -const char gateway_rcs[] = "$Id: gateway.c,v 1.41 2008/11/08 15:29:58 fabiankeil Exp $"; +const char gateway_rcs[] = "$Id: gateway.c,v 1.43 2008/11/13 09:15:51 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/gateway.c,v $ @@ -34,6 +34,12 @@ const char gateway_rcs[] = "$Id: gateway.c,v 1.41 2008/11/08 15:29:58 fabiankeil * * Revisions : * $Log: gateway.c,v $ + * Revision 1.43 2008/11/13 09:15:51 fabiankeil + * Make keep_alive_timeout static. + * + * Revision 1.42 2008/11/13 09:08:42 fabiankeil + * Add new config option: keep-alive-timeout. + * * Revision 1.41 2008/11/08 15:29:58 fabiankeil * Unify two debug messages. * @@ -313,7 +319,7 @@ static const char socks_userid[] = "anonymous"; #ifdef FEATURE_CONNECTION_KEEP_ALIVE #define MAX_REUSABLE_CONNECTIONS 100 -int keep_alive_timeout = DEFAULT_KEEP_ALIVE_TIMEOUT; +static int keep_alive_timeout = DEFAULT_KEEP_ALIVE_TIMEOUT; struct reusable_connection { @@ -882,13 +888,7 @@ jb_socket forwarded_connect(const struct forward_spec * fwd, #ifdef FEATURE_CONNECTION_KEEP_ALIVE sfd = get_reusable_connection(http, fwd); - if (JB_INVALID_SOCKET == sfd) - { - log_error(LOG_LEVEL_CONNECT, - "No reusable socket for %s:%d found. Opening a new one.", - http->host, http->port); - } - else + if (JB_INVALID_SOCKET != sfd) { return sfd; } @@ -927,6 +927,13 @@ jb_socket forwarded_connect(const struct forward_spec * fwd, "SOCKS4 impossible internal error - bad SOCKS type."); } + if (JB_INVALID_SOCKET != sfd) + { + log_error(LOG_LEVEL_CONNECT, + "Created new connection to %s:%d on socket %d.", + http->host, http->port, sfd); + } + return sfd; }