From: Fabian Keil Date: Sun, 4 May 2008 13:30:56 +0000 (+0000) Subject: Streamline parse_http_url()'s prototype. X-Git-Tag: v_3_0_9~123 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=8fe6bb275095d03b4dc1c68edf2dd72babf56428 Streamline parse_http_url()'s prototype. --- diff --git a/cgisimple.c b/cgisimple.c index d7b23fc1..a93e7bb8 100644 --- a/cgisimple.c +++ b/cgisimple.c @@ -1,4 +1,4 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.77 2008/05/02 09:47:48 fabiankeil Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.78 2008/05/03 16:50:11 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ @@ -36,6 +36,9 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.77 2008/05/02 09:47:48 fabian * * Revisions : * $Log: cgisimple.c,v $ + * Revision 1.78 2008/05/03 16:50:11 fabiankeil + * Leverage content_filters_enabled() in cgi_show_url_info(). + * * Revision 1.77 2008/05/02 09:47:48 fabiankeil * In cgi_show_url_info, pass an initialized http structure * to parse_http_url() as that will be required soonish and @@ -1470,7 +1473,7 @@ jb_err cgi_show_url_info(struct client_state *csp, } memset(url_to_query, '\0', sizeof(url_to_query)); - err = parse_http_url(url_param, url_to_query, csp); + err = parse_http_url(url_param, url_to_query); assert(url_to_query->ssl == !strncmp(url_param, "https://", 8)); free(url_param); diff --git a/urlmatch.c b/urlmatch.c index 2f2c0cf2..4ba17cf1 100644 --- a/urlmatch.c +++ b/urlmatch.c @@ -1,4 +1,4 @@ -const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.41 2008/05/02 09:51:34 fabiankeil Exp $"; +const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.42 2008/05/04 13:24:16 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/urlmatch.c,v $ @@ -33,6 +33,9 @@ const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.41 2008/05/02 09:51:34 fabianke * * Revisions : * $Log: urlmatch.c,v $ + * Revision 1.42 2008/05/04 13:24:16 fabiankeil + * If the method isn't CONNECT, reject URLs without protocol. + * * Revision 1.41 2008/05/02 09:51:34 fabiankeil * In parse_http_url(), don't muck around with values * that are none of its business: require an initialized @@ -368,7 +371,6 @@ jb_err init_domain_components(struct http_request *http) * 1 : url = URL (or is it URI?) to break down * 2 : http = pointer to the http structure to hold elements. * Must be initialized with valid values (like NULLs). - * 3 : csp = Current client state (buffers, headers, etc...) * * Returns : JB_ERR_OK on success * JB_ERR_MEMORY on out of memory @@ -376,9 +378,7 @@ jb_err init_domain_components(struct http_request *http) * or >100 domains deep. * *********************************************************************/ -jb_err parse_http_url(const char * url, - struct http_request *http, - const struct client_state *csp) +jb_err parse_http_url(const char * url, struct http_request *http) { int host_available = 1; /* A proxy can dream. */ @@ -668,7 +668,7 @@ jb_err parse_http_request(const char *req, http->ssl = !strcmpic(v[0], "CONNECT"); - err = parse_http_url(v[1], http, csp); + err = parse_http_url(v[1], http); if (err) { freez(buf); diff --git a/urlmatch.h b/urlmatch.h index 975e7d41..b83ae721 100644 --- a/urlmatch.h +++ b/urlmatch.h @@ -1,6 +1,6 @@ #ifndef URLMATCH_H_INCLUDED #define URLMATCH_H_INCLUDED -#define URLMATCH_H_VERSION "$Id: urlmatch.h,v 1.9 2008/04/08 16:07:39 fabiankeil Exp $" +#define URLMATCH_H_VERSION "$Id: urlmatch.h,v 1.10 2008/04/14 18:11:21 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/urlmatch.h,v $ @@ -35,6 +35,11 @@ * * Revisions : * $Log: urlmatch.h,v $ + * Revision 1.10 2008/04/14 18:11:21 fabiankeil + * The compiler might not notice it, but the buffer passed to + * create_url_spec() is modified later on and thus shouldn't + * be declared immutable. + * * Revision 1.9 2008/04/08 16:07:39 fabiankeil * Make it harder to mistake url_match()'s * second parameter for an url_spec. @@ -92,9 +97,7 @@ extern jb_err init_domain_components(struct http_request *http); extern jb_err parse_http_request(const char *req, struct http_request *http, const struct client_state *csp); -extern jb_err parse_http_url(const char * url, - struct http_request *http, - const struct client_state *csp); +extern jb_err parse_http_url(const char *url, struct http_request *http); extern int url_match(const struct url_spec *pattern, const struct http_request *http);