-const char jcc_rcs[] = "$Id: jcc.c,v 1.115 2006/12/29 17:38:57 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.116 2006/12/29 19:08:22 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.116 2006/12/29 19:08:22 fabiankeil
+ * Reverted parts of my last commit
+ * to keep error handling working.
+ *
* Revision 1.115 2006/12/29 17:38:57 fabiankeil
* Fixed gcc43 conversion warnings.
*
{
/*
* Intercepted or invalid request without domain
- * inside the request line. Try to get it another way.
+ * inside the request line. Try to get it another way,
+ * unless accept-intercepted-requests is disabled.
*/
- if (JB_ERR_OK == get_destination_from_headers(headers, http))
+ if (!(csp->config->feature_flags & RUNTIME_FEATURE_ACCEPT_INTERCEPTED_REQUESTS))
+ {
+ log_error(LOG_LEVEL_ERROR, "%s's request: \'%s\' is invalid."
+ " Privoxy isn't configured to accept intercepted requests.",
+ csp->ip_addr_str, http->cmd);
+ log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 400 0", csp->ip_addr_str, http->cmd);
+
+ strcpy(buf, CHEADER);
+ write_socket(csp->cfd, buf, strlen(buf));
+ free_http_request(http);
+ destroy_list(headers);
+ return;
+ }
+ else if (JB_ERR_OK == get_destination_from_headers(headers, http))
{
/* Split the domain we just got for pattern matching */
init_domain_components(http);
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.57 2006/12/21 12:57:48 fabiankeil Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.58 2006/12/31 14:24:29 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
*
* Revisions :
* $Log: loadcfg.c,v $
+ * Revision 1.58 2006/12/31 14:24:29 fabiankeil
+ * Fix gcc43 compiler warnings.
+ *
* Revision 1.57 2006/12/21 12:57:48 fabiankeil
* Add config option "split-large-forms"
* to work around the browser bug reported
* console and GUI specific options last).
*/
-#define hash_actions_file 1196306641ul /* "actionsfile" */
-#define hash_admin_address 4112573064ul /* "admin-address" */
-#define hash_buffer_limit 1881726070ul /* "buffer-limit */
-#define hash_confdir 1978389ul /* "confdir" */
-#define hash_debug 78263ul /* "debug" */
-#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" */
-#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" */
-#define hash_logfile 2114766ul /* "logfile" */
-#define hash_permit_access 3587953268ul /* "permit-access" */
-#define hash_proxy_info_url 3903079059ul /* "proxy-info-url" */
-#define hash_single_threaded 4250084780ul /* "single-threaded" */
-#define hash_split_large_cgi_forms 671658948ul /* "split-large-cgi-forms" */
-#define hash_suppress_blocklists 1948693308ul /* "suppress-blocklists" */
-#define hash_toggle 447966ul /* "toggle" */
-#define hash_trust_info_url 430331967ul /* "trust-info-url" */
-#define hash_trustfile 56494766ul /* "trustfile" */
-#define hash_usermanual 1416668518ul /* "user-manual" */
-#define hash_activity_animation 1817904738ul /* "activity-animation" */
-#define hash_close_button_minimizes 3651284693ul /* "close-button-minimizes" */
-#define hash_hide_console 2048809870ul /* "hide-console" */
-#define hash_log_buffer_size 2918070425ul /* "log-buffer-size" */
-#define hash_log_font_name 2866730124ul /* "log-font-name" */
-#define hash_log_font_size 2866731014ul /* "log-font-size" */
-#define hash_log_highlight_messages 4032101240ul /* "log-highlight-messages" */
-#define hash_log_max_lines 2868344173ul /* "log-max-lines" */
-#define hash_log_messages 2291744899ul /* "log-messages" */
-#define hash_show_on_task_bar 215410365ul /* "show-on-task-bar" */
+#define hash_actions_file 1196306641ul /* "actionsfile" */
+#define hash_accept_intercepted_requests 1513024973ul /* "accept-intercepted-requests" */
+#define hash_admin_address 4112573064ul /* "admin-address" */
+#define hash_buffer_limit 1881726070ul /* "buffer-limit */
+#define hash_confdir 1978389ul /* "confdir" */
+#define hash_debug 78263ul /* "debug" */
+#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" */
+#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" */
+#define hash_logfile 2114766ul /* "logfile" */
+#define hash_permit_access 3587953268ul /* "permit-access" */
+#define hash_proxy_info_url 3903079059ul /* "proxy-info-url" */
+#define hash_single_threaded 4250084780ul /* "single-threaded" */
+#define hash_split_large_cgi_forms 671658948ul /* "split-large-cgi-forms" */
+#define hash_suppress_blocklists 1948693308ul /* "suppress-blocklists" */
+#define hash_toggle 447966ul /* "toggle" */
+#define hash_trust_info_url 430331967ul /* "trust-info-url" */
+#define hash_trustfile 56494766ul /* "trustfile" */
+#define hash_usermanual 1416668518ul /* "user-manual" */
+#define hash_activity_animation 1817904738ul /* "activity-animation" */
+#define hash_close_button_minimizes 3651284693ul /* "close-button-minimizes" */
+#define hash_hide_console 2048809870ul /* "hide-console" */
+#define hash_log_buffer_size 2918070425ul /* "log-buffer-size" */
+#define hash_log_font_name 2866730124ul /* "log-font-name" */
+#define hash_log_font_size 2866731014ul /* "log-font-size" */
+#define hash_log_highlight_messages 4032101240ul /* "log-highlight-messages" */
+#define hash_log_max_lines 2868344173ul /* "log-max-lines" */
+#define hash_log_messages 2291744899ul /* "log-messages" */
+#define hash_show_on_task_bar 215410365ul /* "show-on-task-bar" */
static void savearg(char *command, char *argument, struct configuration_spec * config);
config->forwarded_connect_retries = 0;
config->feature_flags &= ~RUNTIME_FEATURE_CGI_TOGGLE;
config->feature_flags &= ~RUNTIME_FEATURE_SPLIT_LARGE_FORMS;
+ config->feature_flags &= ~RUNTIME_FEATURE_ACCEPT_INTERCEPTED_REQUESTS;
if ((configfp = fopen(configfile, "r")) == NULL)
{
config->actions_file[i] = make_path(config->confdir, p);
free(p);
continue;
+/* *************************************************************************
+ * accept-intercepted-requests
+ * *************************************************************************/
+ case hash_accept_intercepted_requests:
+ if ((*arg != '\0') && (0 != atoi(arg)))
+ {
+ config->feature_flags |= RUNTIME_FEATURE_ACCEPT_INTERCEPTED_REQUESTS;
+ }
+ else
+ {
+ config->feature_flags &= ~RUNTIME_FEATURE_ACCEPT_INTERCEPTED_REQUESTS;
+ }
+ continue;
/* *************************************************************************
* admin-address email-address
#ifndef PROJECT_H_INCLUDED
#define PROJECT_H_INCLUDED
/** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.84 2006/12/21 12:57:48 fabiankeil Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.85 2006/12/31 15:03:31 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/project.h,v $
*
* Revisions :
* $Log: project.h,v $
+ * Revision 1.85 2006/12/31 15:03:31 fabiankeil
+ * Fix gcc43 compiler warnings and a comment.
+ *
* Revision 1.84 2006/12/21 12:57:48 fabiankeil
* Add config option "split-large-forms"
* to work around the browser bug reported
/** configuration_spec::feature_flags: CGI actions editor. */
-#define RUNTIME_FEATURE_CGI_EDIT_ACTIONS 1
+#define RUNTIME_FEATURE_CGI_EDIT_ACTIONS 1
/** configuration_spec::feature_flags: Web-based toggle. */
-#define RUNTIME_FEATURE_CGI_TOGGLE 2
+#define RUNTIME_FEATURE_CGI_TOGGLE 2
/** configuration_spec::feature_flags: HTTP-header-based toggle. */
-#define RUNTIME_FEATURE_HTTP_TOGGLE 4
+#define RUNTIME_FEATURE_HTTP_TOGGLE 4
/** configuration_spec::feature_flags: Split large forms to limit the number of GET arguments. */
-#define RUNTIME_FEATURE_SPLIT_LARGE_FORMS 8
+#define RUNTIME_FEATURE_SPLIT_LARGE_FORMS 8
+
+/** configuration_spec::feature_flags: Check the host header for requests with host-less request lines. */
+#define RUNTIME_FEATURE_ACCEPT_INTERCEPTED_REQUESTS 16
+
/**
* Data loaded from the configuration file.