-const char gateway_rcs[] = "$Id: gateway.c,v 1.58 2009/08/19 15:22:18 fabiankeil Exp $";
+const char gateway_rcs[] = "$Id: gateway.c,v 1.59 2009/09/06 14:09:19 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/gateway.c,v $
static const char socks_userid[] = "anonymous";
-#ifdef FEATURE_CONNECTION_KEEP_ALIVE
+#ifdef FEATURE_CONNECTION_SHARING
#define MAX_REUSABLE_CONNECTIONS 100
static unsigned int keep_alive_timeout = DEFAULT_KEEP_ALIVE_TIMEOUT;
privoxy_mutex_unlock(&connection_reuse_mutex);
}
+#endif /* def FEATURE_CONNECTION_SHARING */
+#ifdef FEATURE_CONNECTION_KEEP_ALIVE
/*********************************************************************
*
* Function : mark_connection_closed
freez(closed_connection->forward_host);
closed_connection->forward_port = 0;
}
+#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
+#ifdef FEATURE_CONNECTION_SHARING
/*********************************************************************
*
* Function : forget_connection
privoxy_mutex_unlock(&connection_reuse_mutex);
}
+#endif /* def FEATURE_CONNECTION_SHARING */
+#ifdef FEATURE_CONNECTION_KEEP_ALIVE
/*********************************************************************
*
* Function : connection_destination_matches
return (!strcmpic(connection->host, http->host));
}
+#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
+#ifdef FEATURE_CONNECTION_SHARING
/*********************************************************************
*
* Function : close_unusable_connections
{
keep_alive_timeout = timeout;
}
-#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
+#endif /* def FEATURE_CONNECTION_SHARING */
/*********************************************************************
int dest_port;
jb_socket sfd = JB_INVALID_SOCKET;
-#ifdef FEATURE_CONNECTION_KEEP_ALIVE
+#ifdef FEATURE_CONNECTION_SHARING
if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_SHARING)
&& !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED))
{
return sfd;
}
}
-#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
+#endif /* def FEATURE_CONNECTION_SHARING */
/* Figure out if we need to connect to the web server or a HTTP proxy. */
if (fwd->forward_host)
#ifndef GATEWAY_H_INCLUDED
#define GATEWAY_H_INCLUDED
-#define GATEWAY_H_VERSION "$Id: gateway.h,v 1.16 2009/05/16 13:27:20 fabiankeil Exp $"
+#define GATEWAY_H_VERSION "$Id: gateway.h,v 1.17 2009/07/11 14:49:09 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/gateway.h,v $
extern jb_socket forwarded_connect(const struct forward_spec * fwd,
struct http_request *http,
struct client_state *csp);
-#ifdef FEATURE_CONNECTION_KEEP_ALIVE
/*
* Default number of seconds after which an
*/
#define DEFAULT_KEEP_ALIVE_TIMEOUT 180
+#ifdef FEATURE_CONNECTION_SHARING
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(const struct client_state *csp,
const struct forward_spec *fwd);
extern int close_unusable_connections(void);
+#endif /* FEATURE_CONNECTION_SHARING */
+
+#ifdef FEATURE_CONNECTION_KEEP_ALIVE
extern void mark_connection_closed(struct reusable_connection *closed_connection);
extern int connection_destination_matches(const struct reusable_connection *connection,
const struct http_request *http,
const struct forward_spec *fwd);
-#endif /* FEATURE_CONNECTION_KEEP_ALIVE */
-
+#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
/*
* Solaris fix
-const char jcc_rcs[] = "$Id: jcc.c,v 1.283 2009/09/05 18:04:37 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.284 2009/09/06 14:07:56 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
}
+#ifdef FEATURE_CONNECTION_SHARING
/*********************************************************************
*
* Function : wait_for_alive_connections
log_error(LOG_LEVEL_CONNECT, "No connections to wait for left.");
}
+#endif /* def FEATURE_CONNECTION_SHARING */
/*********************************************************************
#endif /* def AMIGA */
{
#ifdef FEATURE_CONNECTION_KEEP_ALIVE
+#ifdef FEATURE_CONNECTION_SHARING
static int monitor_thread_running = 0;
+#endif /* def FEATURE_CONNECTION_SHARING */
int continue_chatting = 0;
unsigned int latency = 0;
{
log_error(LOG_LEVEL_CONNECT,
"No additional client request received in time.");
+#ifdef FEATURE_CONNECTION_SHARING
if ((csp->config->feature_flags & RUNTIME_FEATURE_CONNECTION_SHARING)
&& (socket_is_still_usable(csp->sfd)))
{
}
privoxy_mutex_unlock(&connection_reuse_mutex);
}
+#endif /* def FEATURE_CONNECTION_SHARING */
break;
}
}
if (csp->sfd != JB_INVALID_SOCKET)
{
-#ifdef FEATURE_CONNECTION_KEEP_ALIVE
+#ifdef FEATURE_CONNECTION_SHARING
forget_connection(csp->sfd);
-#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
+#endif /* def FEATURE_CONNECTION_SHARING */
close_socket(csp->sfd);
}
config = load_config();
-#ifdef FEATURE_CONNECTION_KEEP_ALIVE
+#ifdef FEATURE_CONNECTION_SHARING
/*
* XXX: Should be relocated once it no
* longer needs to emit log messages.
*/
initialize_reusable_connections();
-#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */
+#endif /* def FEATURE_CONNECTION_SHARING */
bfd = bind_port_helper(config);
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.103 2009/06/15 20:50:56 fabiankeil Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.104 2009/07/19 10:07:46 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
/* *************************************************************************
* connection-sharing (0|1)
* *************************************************************************/
-#ifdef FEATURE_CONNECTION_KEEP_ALIVE
+#ifdef FEATURE_CONNECTION_SHARING
case hash_connection_sharing :
if ((*arg != '\0') && (0 != atoi(arg)))
{
}
}
-#ifdef FEATURE_CONNECTION_KEEP_ALIVE
+#ifdef FEATURE_CONNECTION_SHARING
if (config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE)
{
if (config->multi_threaded)
"has no effect if keep-alive-timeout isn't set.");
config->feature_flags &= ~RUNTIME_FEATURE_CONNECTION_SHARING;
}
-#endif
+#endif /* def FEATURE_CONNECTION_SHARING */
if (NULL == config->proxy_args)
{