-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.50 2006/07/18 14:48:46 david__schmidt Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.51 2006/09/06 09:23:37 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
*
* Revisions :
* $Log: loadcfg.c,v $
+ * Revision 1.51 2006/09/06 09:23:37 fabiankeil
+ * Make number of retries in case of forwarded-connect problems
+ * a config file option (forwarded-connect-retries) and use 0 as
+ * default.
+ *
* 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)
#define hash_deny_access 1227333715ul /* "deny-access" */
#define hash_enable_edit_actions 2517097536ul /* "enable-edit-actions" */
#define hash_enable_remote_toggle 2979744683ul /* "enable-remote-toggle" */
+#define hash_enable_remote_http_toggle 110543988ul /* "enable-remote-http-toggle" */
#define hash_filterfile 250887266ul /* "filterfile" */
#define hash_forward 2029845ul /* "forward" */
#define hash_forward_socks4 3963965521ul /* "forward-socks4" */
config->usermanual = strdup(USER_MANUAL_URL);
config->proxy_args = strdup("");
config->forwarded_connect_retries = 0;
+ config->feature_flags &= ~RUNTIME_FEATURE_CGI_TOGGLE;
if ((configfp = fopen(configfile, "r")) == NULL)
{
continue;
#endif /* def FEATURE_CGI_EDIT_ACTIONS */
+/* *************************************************************************
+ * enable-remote-http-toggle 0|1
+ * *************************************************************************/
+ case hash_enable_remote_http_toggle:
+ if ((*arg != '\0') && (0 != atoi(arg)))
+ {
+ config->feature_flags |= RUNTIME_FEATURE_HTTP_TOGGLE;
+ }
+ else
+ {
+ config->feature_flags &= ~RUNTIME_FEATURE_HTTP_TOGGLE;
+ }
+ continue;
+
/* *************************************************************************
* filterfile file-name
* In confdir by default.
-const char parsers_rcs[] = "$Id: parsers.c,v 1.66 2006/09/03 19:38:28 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.67 2006/09/04 11:01:26 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
*
* Revisions :
* $Log: parsers.c,v $
+ * Revision 1.67 2006/09/04 11:01:26 fabiankeil
+ * After filtering de-chunked instances, remove
+ * "Transfer-Encoding" header entirely instead of changing
+ * it to "Transfer-Encoding: identity", which is invalid.
+ * Thanks Michael Shields <shields@msrl.com>. Fixes PR 1318658.
+ *
+ * Don't use localtime in parse_header_time. An empty time struct
+ * is good enough, it gets overwritten by strptime anyway.
+ *
* Revision 1.66 2006/09/03 19:38:28 fabiankeil
* Use gmtime_r if available, fallback to gmtime with mutex
* protection for MacOSX and use vanilla gmtime for the rest.
{
if ( 0 == strcmpic(*header, "X-Filter: No"))
{
- if (csp->action->flags & ACTION_FORCE_TEXT_MODE)
+ if (!(csp->config->feature_flags & RUNTIME_FEATURE_HTTP_TOGGLE))
{
- log_error(LOG_LEVEL_HEADER, "force-text-mode overruled the client's request to disable filtering!");
+ log_error(LOG_LEVEL_INFO, "Ignored the client's request to fetch without filtering.");
}
- else
- {
- csp->content_type = CT_TABOO;
- log_error(LOG_LEVEL_HEADER, "Disabled filter mode on behalf of the client.");
+ else
+ {
+ if (csp->action->flags & ACTION_FORCE_TEXT_MODE)
+ {
+ log_error(LOG_LEVEL_HEADER, "force-text-mode overruled the client's request to fetch without filtering!");
+ }
+ else
+ {
+ csp->content_type = CT_TABOO;
+ log_error(LOG_LEVEL_HEADER, "Accepted the client's request to fetch without filtering.");
+ }
+ log_error(LOG_LEVEL_HEADER, "Crunching %s", *header);
+ freez(*header);
}
- log_error(LOG_LEVEL_HEADER, "Crunching %s", *header);
- freez(*header);
}
return JB_ERR_OK;
}
#ifndef PROJECT_H_INCLUDED
#define PROJECT_H_INCLUDED
/** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.78 2006/08/31 16:25:06 fabiankeil Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.79 2006/09/06 09:23:37 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/project.h,v $
*
* Revisions :
* $Log: project.h,v $
+ * Revision 1.79 2006/09/06 09:23:37 fabiankeil
+ * Make number of retries in case of forwarded-connect problems
+ * a config file option (forwarded-connect-retries) and use 0 as
+ * default.
+ *
* 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
/** configuration_spec::feature_flags: Web-based toggle. */
#define RUNTIME_FEATURE_CGI_TOGGLE 2
+/** configuration_spec::feature_flags: HTTP-header-based toggle. */
+#define RUNTIME_FEATURE_HTTP_TOGGLE 4
/**
* Data loaded from the configuration file.
/** 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:
*
* - RUNTIME_FEATURE_CGI_EDIT_ACTIONS
* - RUNTIME_FEATURE_CGI_TOGGLE
+ * - RUNTIME_FEATURE_HTTP_TOGGLE
*/
unsigned feature_flags;
/** Information about parent proxies (forwarding). */
struct forward_spec *forward;
+ /** Number of retries in case a forwarded connection attempt fails */
+ int forwarded_connect_retries;
+
/** All options from the config file, HTML-formatted. */
char *proxy_args;