From: Fabian Keil Date: Sat, 23 Feb 2008 16:33:43 +0000 (+0000) Subject: Let forward_url() use the standard parameter ordering X-Git-Tag: v_3_0_9~224 X-Git-Url: http://www.privoxy.org/gitweb/%22http:/sourceforge.net/tracker/?a=commitdiff_plain;h=f08e3d0ab8d466e41e4f7be61dce8e4f8b869d79;p=privoxy.git Let forward_url() use the standard parameter ordering and mark its second parameter immutable. --- diff --git a/cgi.c b/cgi.c index 502d88e6..bd0c8f6f 100644 --- a/cgi.c +++ b/cgi.c @@ -1,4 +1,4 @@ -const char cgi_rcs[] = "$Id: cgi.c,v 1.100 2007/10/17 18:40:53 fabiankeil Exp $"; +const char cgi_rcs[] = "$Id: cgi.c,v 1.101 2008/02/03 15:45:06 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.c,v $ @@ -38,6 +38,9 @@ const char cgi_rcs[] = "$Id: cgi.c,v 1.100 2007/10/17 18:40:53 fabiankeil Exp $" * * Revisions : * $Log: cgi.c,v $ + * Revision 1.101 2008/02/03 15:45:06 fabiankeil + * Add SOCKS5 support for "Forwarding failure" CGI page. + * * Revision 1.100 2007/10/17 18:40:53 fabiankeil * - Send CGI pages as HTTP/1.1 unless the client asked for HTTP/1.0. * - White space fix. @@ -1432,7 +1435,7 @@ struct http_response *error_response(struct client_state *csp, } else if (!strcmp(templatename, "forwarding-failed")) { - const struct forward_spec * fwd = forward_url(csp->http, csp); + const struct forward_spec *fwd = forward_url(csp, csp->http); char *socks_type = NULL; if (fwd == NULL) { diff --git a/cgisimple.c b/cgisimple.c index 6b329c6c..dd3c8870 100644 --- a/cgisimple.c +++ b/cgisimple.c @@ -1,4 +1,4 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.63 2008/02/01 06:04:31 fabiankeil Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.64 2008/02/03 13:56:07 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ @@ -36,6 +36,9 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.63 2008/02/01 06:04:31 fabian * * Revisions : * $Log: cgisimple.c,v $ + * Revision 1.64 2008/02/03 13:56:07 fabiankeil + * Add SOCKS5 support for show-url-info CGI page. + * * Revision 1.63 2008/02/01 06:04:31 fabiankeil * If edit buttons on the show-url-info CGI page are hidden, explain why. * @@ -1649,7 +1652,7 @@ jb_err cgi_show_url_info(struct client_state *csp, * display the proxy port and an eventual second forwarder. */ { - const struct forward_spec * fwd = forward_url(url_to_query, csp); + const struct forward_spec *fwd = forward_url(csp, url_to_query); if ((fwd->gateway_host == NULL) && (fwd->forward_host == NULL)) { diff --git a/filters.c b/filters.c index b91a3fbb..9c9ae2e6 100644 --- a/filters.c +++ b/filters.c @@ -1,4 +1,4 @@ -const char filters_rcs[] = "$Id: filters.c,v 1.98 2008/01/04 17:43:45 fabiankeil Exp $"; +const char filters_rcs[] = "$Id: filters.c,v 1.99 2008/02/03 13:57:58 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.c,v $ @@ -40,6 +40,9 @@ const char filters_rcs[] = "$Id: filters.c,v 1.98 2008/01/04 17:43:45 fabiankeil * * Revisions : * $Log: filters.c,v $ + * Revision 1.99 2008/02/03 13:57:58 fabiankeil + * Add SOCKS5 support for forward-override{}. + * * Revision 1.98 2008/01/04 17:43:45 fabiankeil * Improve the warning messages that get logged if the action files * "enable" filters but no filters of that type have been loaded. @@ -2431,7 +2434,7 @@ void apply_url_actions(struct current_action_spec *action, * Invalid syntax is fatal. * *********************************************************************/ -static const struct forward_spec *get_forward_override_settings(struct client_state *csp) +const static struct forward_spec *get_forward_override_settings(struct client_state *csp) { const char *forward_override_line = csp->action->string[ACTION_STRING_FORWARD_OVERRIDE]; char forward_settings[BUFFER_SIZE]; @@ -2558,17 +2561,15 @@ static const struct forward_spec *get_forward_override_settings(struct client_st * * Description : Should we forward this to another proxy? * - * XXX: Should be changed to make use of csp->fwd. - * * Parameters : - * 1 : http = http_request request for current URL - * 2 : csp = Current client state (buffers, headers, etc...) + * 1 : csp = Current client state (buffers, headers, etc...) + * 2 : http = http_request request for current URL * * Returns : Pointer to forwarding information. * *********************************************************************/ -const struct forward_spec * forward_url(struct http_request *http, - struct client_state *csp) +const struct forward_spec *forward_url(struct client_state *csp, + const struct http_request *http) { static const struct forward_spec fwd_default[1] = { FORWARD_SPEC_INITIALIZER }; struct forward_spec *fwd = csp->config->forward; diff --git a/filters.h b/filters.h index f768047f..4206484a 100644 --- a/filters.h +++ b/filters.h @@ -1,6 +1,6 @@ #ifndef FILTERS_H_INCLUDED #define FILTERS_H_INCLUDED -#define FILTERS_H_VERSION "$Id: filters.h,v 1.30 2007/09/29 10:21:16 fabiankeil Exp $" +#define FILTERS_H_VERSION "$Id: filters.h,v 1.31 2007/10/19 16:53:28 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.h,v $ @@ -39,6 +39,9 @@ * * Revisions : * $Log: filters.h,v $ + * Revision 1.31 2007/10/19 16:53:28 fabiankeil + * Add helper function to check if any content filters are enabled. + * * Revision 1.30 2007/09/29 10:21:16 fabiankeil * - Move get_filter_function() from jcc.c to filters.c * so the filter functions can be static. @@ -306,7 +309,8 @@ extern void apply_url_actions(struct current_action_spec *action, /* * Determining parent proxies */ -extern const struct forward_spec *forward_url(struct http_request *http, struct client_state *csp); +extern const struct forward_spec *forward_url(struct client_state *csp, + const struct http_request *http); /* * Content modification @@ -327,7 +331,7 @@ extern inline int content_filters_enabled(const struct client_state *csp); /* * Handling Max-Forwards: */ -extern struct http_response *direct_response( struct client_state *csp); +extern struct http_response *direct_response(struct client_state *csp); /* diff --git a/jcc.c b/jcc.c index 794bcacc..2dc8cc3b 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.164 2007/12/16 18:32:46 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.165 2008/02/02 19:36:56 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -33,6 +33,11 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.164 2007/12/16 18:32:46 fabiankeil Exp $" * * Revisions : * $Log: jcc.c,v $ + * Revision 1.165 2008/02/02 19:36:56 fabiankeil + * Remove the "Listening ... for local connections only" log message. + * Whether or not remote connections are able to reach Privoxy is up + * to the operating system. + * * Revision 1.164 2007/12/16 18:32:46 fabiankeil * Prevent the log messages for CONNECT requests to unacceptable * ports from printing the limit-connect argument as [null] if @@ -2135,7 +2140,8 @@ static void chat(struct client_state *csp) } /* decide how to route the HTTP request */ - if (NULL == (fwd = forward_url(http, csp))) + fwd = forward_url(csp, http); + if (NULL == fwd) { log_error(LOG_LEVEL_FATAL, "gateway spec is NULL!?!? This can't happen!"); /* Never get here - LOG_LEVEL_FATAL causes program exit */