From e8db07c2f0720685bb504013a6a1e576b0cf718f Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 13 May 2009 18:20:54 +0000 Subject: [PATCH] There's no reason for keep_alive_timeout to be signed. --- gateway.c | 10 +++++++--- gateway.h | 8 ++++++-- loadcfg.c | 8 ++++++-- project.h | 8 ++++++-- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/gateway.c b/gateway.c index 3c251fe3..8aaf7e28 100644 --- a/gateway.c +++ b/gateway.c @@ -1,4 +1,4 @@ -const char gateway_rcs[] = "$Id: gateway.c,v 1.49 2009/05/10 10:12:30 fabiankeil Exp $"; +const char gateway_rcs[] = "$Id: gateway.c,v 1.50 2009/05/10 10:19:23 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/gateway.c,v $ @@ -34,6 +34,10 @@ const char gateway_rcs[] = "$Id: gateway.c,v 1.49 2009/05/10 10:12:30 fabiankeil * * Revisions : * $Log: gateway.c,v $ + * Revision 1.50 2009/05/10 10:19:23 fabiankeil + * Reenable server-side-only keep-alive support, but only share + * outgoing connections if the connection-sharing option is set. + * * Revision 1.49 2009/05/10 10:12:30 fabiankeil * Initial keep-alive support for the client socket. * Temporarily disable the server-side-only keep-alive code. @@ -341,7 +345,7 @@ static const char socks_userid[] = "anonymous"; #ifdef FEATURE_CONNECTION_KEEP_ALIVE #define MAX_REUSABLE_CONNECTIONS 100 -static int keep_alive_timeout = DEFAULT_KEEP_ALIVE_TIMEOUT; +static unsigned int keep_alive_timeout = DEFAULT_KEEP_ALIVE_TIMEOUT; static struct reusable_connection reusable_connection[MAX_REUSABLE_CONNECTIONS]; static int mark_connection_unused(jb_socket sfd); @@ -773,7 +777,7 @@ static int mark_connection_unused(jb_socket sfd) * Returns : void * *********************************************************************/ -void set_keep_alive_timeout(int timeout) +void set_keep_alive_timeout(unsigned int timeout) { keep_alive_timeout = timeout; } diff --git a/gateway.h b/gateway.h index eb439ca4..e89ff34b 100644 --- a/gateway.h +++ b/gateway.h @@ -1,6 +1,6 @@ #ifndef GATEWAY_H_INCLUDED #define GATEWAY_H_INCLUDED -#define GATEWAY_H_VERSION "$Id: gateway.h,v 1.12 2008/12/24 17:06:19 fabiankeil Exp $" +#define GATEWAY_H_VERSION "$Id: gateway.h,v 1.13 2009/05/10 10:12:30 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/gateway.h,v $ @@ -36,6 +36,10 @@ * * Revisions : * $Log: gateway.h,v $ + * Revision 1.13 2009/05/10 10:12:30 fabiankeil + * Initial keep-alive support for the client socket. + * Temporarily disable the server-side-only keep-alive code. + * * Revision 1.12 2008/12/24 17:06:19 fabiankeil * Keep a thread around to timeout alive connections * even if no new requests are coming in. @@ -122,7 +126,7 @@ extern jb_socket forwarded_connect(const struct forward_spec * fwd, */ #define DEFAULT_KEEP_ALIVE_TIMEOUT 180 -extern void set_keep_alive_timeout(int timeout); +extern void set_keep_alive_timeout(unsigned int timeout); extern void initialize_reusable_connections(void); extern void forget_connection(jb_socket sfd); extern void remember_connection(jb_socket sfd, diff --git a/loadcfg.c b/loadcfg.c index 0d026e4c..db55afca 100644 --- a/loadcfg.c +++ b/loadcfg.c @@ -1,4 +1,4 @@ -const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.99 2009/05/10 10:12:30 fabiankeil Exp $"; +const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.100 2009/05/10 10:19:23 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $ @@ -35,6 +35,10 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.99 2009/05/10 10:12:30 fabiankeil * * Revisions : * $Log: loadcfg.c,v $ + * Revision 1.100 2009/05/10 10:19:23 fabiankeil + * Reenable server-side-only keep-alive support, but only share + * outgoing connections if the connection-sharing option is set. + * * Revision 1.99 2009/05/10 10:12:30 fabiankeil * Initial keep-alive support for the client socket. * Temporarily disable the server-side-only keep-alive code. @@ -1414,7 +1418,7 @@ struct configuration_spec * load_config(void) if (0 <= timeout) { config->feature_flags |= RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE; - config->keep_alive_timeout = timeout; + config->keep_alive_timeout = (unsigned int)timeout; } else { diff --git a/project.h b/project.h index 8b83f65b..2b0292ae 100644 --- a/project.h +++ b/project.h @@ -1,7 +1,7 @@ #ifndef PROJECT_H_INCLUDED #define PROJECT_H_INCLUDED /** Version string. */ -#define PROJECT_H_VERSION "$Id: project.h,v 1.134 2009/05/10 10:12:30 fabiankeil Exp $" +#define PROJECT_H_VERSION "$Id: project.h,v 1.135 2009/05/10 10:19:23 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/project.h,v $ @@ -37,6 +37,10 @@ * * Revisions : * $Log: project.h,v $ + * Revision 1.135 2009/05/10 10:19:23 fabiankeil + * Reenable server-side-only keep-alive support, but only share + * outgoing connections if the connection-sharing option is set. + * * Revision 1.134 2009/05/10 10:12:30 fabiankeil * Initial keep-alive support for the client socket. * Temporarily disable the server-side-only keep-alive code. @@ -1876,7 +1880,7 @@ struct configuration_spec #ifdef FEATURE_CONNECTION_KEEP_ALIVE /* Number of seconds after which an open connection will no longer be reused. */ - int keep_alive_timeout; + unsigned int keep_alive_timeout; #endif /** All options from the config file, HTML-formatted. */ -- 2.39.2