-const char jcc_rcs[] = "$Id: jcc.c,v 1.99 2006/09/02 15:36:42 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.100 2006/09/03 19:42:59 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.100 2006/09/03 19:42:59 fabiankeil
+ * Set random(3) seed.
+ *
* Revision 1.99 2006/09/02 15:36:42 fabiankeil
* Follow the OpenBSD port's lead and protect the resolve
* functions on OpenBSD as well.
int server_body;
int ms_iis5_hack = 0;
int byte_count = 0;
- unsigned int socks_retries = 0;
+ unsigned int forwarded_connect_retries = 0;
+ unsigned int max_forwarded_connect_retries = csp->config->forwarded_connect_retries;
const struct forward_spec * fwd;
struct http_request *http;
int len; /* for buffer sizes */
/* here we connect to the server, gateway, or the forwarder */
while ( (csp->sfd = forwarded_connect(fwd, http, csp))
- && (errno == EINVAL) && (socks_retries++ < 3))
+ && (errno == EINVAL) && (forwarded_connect_retries++ < max_forwarded_connect_retries))
{
log_error(LOG_LEVEL_ERROR, "failed request #%u to connect to %s. Trying again.",
- socks_retries, http->hostport);
+ forwarded_connect_retries, http->hostport);
}
if (csp->sfd == JB_INVALID_SOCKET)
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.48.2.7 2006/02/02 17:29:16 david__schmidt Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.50 2006/07/18 14:48:46 david__schmidt Exp $";
/*********************************************************************
*
- * File : $Source: /cvsroot/ijbswa/current/Attic/loadcfg.c,v $
+ * File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
*
* Purpose : Loads settings from the configuration file into
* global variables. This file contains both the
*
* Revisions :
* $Log: loadcfg.c,v $
+ * Revision 1.50 2006/07/18 14:48:46 david__schmidt
+ * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
+ * with what was really the latest development (the v_3_0_branch branch)
+ *
* Revision 1.48.2.7 2006/02/02 17:29:16 david__schmidt
* Don't forget to malloc space for the null terminator...
*
#define hash_forward 2029845ul /* "forward" */
#define hash_forward_socks4 3963965521ul /* "forward-socks4" */
#define hash_forward_socks4a 2639958518ul /* "forward-socks4a" */
+#define hash_forwarded_connect_retries 101465292ul /* "forwarded-connect-retries" */
#define hash_jarfile 2046641ul /* "jarfile" */
#define hash_listen_address 1255650842ul /* "listen-address" */
#define hash_logdir 422889ul /* "logdir" */
/*
* Set to defaults
*/
- config->multi_threaded = 1;
- config->hport = HADDR_PORT;
- config->buffer_limit = 4096 * 1024;
- config->usermanual = strdup(USER_MANUAL_URL);
- config->proxy_args = strdup("");
+ config->multi_threaded = 1;
+ config->hport = HADDR_PORT;
+ config->buffer_limit = 4096 * 1024;
+ config->usermanual = strdup(USER_MANUAL_URL);
+ config->proxy_args = strdup("");
+ config->forwarded_connect_retries = 0;
if ((configfp = fopen(configfile, "r")) == NULL)
{
continue;
+/* *************************************************************************
+ * forwarded-connect-retries n
+ * *************************************************************************/
+ case hash_forwarded_connect_retries :
+ config->forwarded_connect_retries = atoi(arg);
+ continue;
+
/* *************************************************************************
* jarfile jar-file-name
* In logdir by default
#ifndef PROJECT_H_INCLUDED
#define PROJECT_H_INCLUDED
/** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.77 2006/08/21 12:50:51 david__schmidt Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.78 2006/08/31 16:25:06 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/project.h,v $
*
* Revisions :
* $Log: project.h,v $
+ * Revision 1.78 2006/08/31 16:25:06 fabiankeil
+ * Work around a buffer overflow that caused Privoxy to
+ * segfault if too many trusted referrers were used. Good
+ * enough for now, but should be replaced with a real
+ * solution after the next release.
+ *
* Revision 1.77 2006/08/21 12:50:51 david__schmidt
* Formatting cleanup
*
/** Nonzero to enable multithreading. */
int multi_threaded;
+ /** Number of retries in case a forwarded connection attempt fails */
+ int forwarded_connect_retries;
+
/**
* Bitmask of features that can be enabled/disabled through the config
* file. Currently defined bits: