From: Fabian Keil <fk@fabiankeil.de>
Date: Mon, 2 Mar 2009 19:18:11 +0000 (+0000)
Subject: Streamline parse_http_request()'s prototype. As
X-Git-Tag: v_3_0_12~43
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/%22https:/user-manual/developer-manual/diff?a=commitdiff_plain;h=bfe28519e62da559f3d37481e8dd82a85e170fea;p=privoxy.git

Streamline parse_http_request()'s prototype. As
cparser pointed out it doesn't actually use csp.
---

diff --git a/jcc.c b/jcc.c
index 414e5fc0..d0d535ea 100644
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.225 2009/02/19 18:09:32 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.226 2009/03/01 18:28:24 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -33,6 +33,10 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.225 2009/02/19 18:09:32 fabiankeil Exp $"
  *
  * Revisions   :
  *    $Log: jcc.c,v $
+ *    Revision 1.226  2009/03/01 18:28:24  fabiankeil
+ *    Help clang understand that we aren't dereferencing
+ *    NULL pointers here.
+ *
  *    Revision 1.225  2009/02/19 18:09:32  fabiankeil
  *    Unbreak build without FEATURE_CONNECTION_KEEP_ALIVE.
  *    Noticed by David.
@@ -2113,7 +2117,7 @@ static jb_err change_request_destination(struct client_state *csp)
 
    log_error(LOG_LEVEL_INFO, "Rewrite detected: %s", csp->headers->first->str);
    free_http_request(http);
-   err = parse_http_request(csp->headers->first->str, http, csp);
+   err = parse_http_request(csp->headers->first->str, http);
    if (JB_ERR_OK != err)
    {
       log_error(LOG_LEVEL_ERROR, "Couldn't parse rewritten request: %s.",
@@ -2351,7 +2355,7 @@ static jb_err receive_client_request(struct client_state *csp)
    }
 #endif /* def FEATURE_FORCE_LOAD */
 
-   err = parse_http_request(req, http, csp);
+   err = parse_http_request(req, http);
    freez(req);
    if (JB_ERR_OK != err)
    {
diff --git a/urlmatch.c b/urlmatch.c
index 65f9ba4f..ce12ecc8 100644
--- a/urlmatch.c
+++ b/urlmatch.c
@@ -1,4 +1,4 @@
-const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.45 2008/06/21 21:19:18 fabiankeil Exp $";
+const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.46 2009/02/11 19:31:32 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
@@ -33,6 +33,9 @@ const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.45 2008/06/21 21:19:18 fabianke
  *
  * Revisions   :
  *    $Log: urlmatch.c,v $
+ *    Revision 1.46  2009/02/11 19:31:32  fabiankeil
+ *    Reject request lines that end with neither HTTP/1.0 nor HTTP/1.1.
+ *
  *    Revision 1.45  2008/06/21 21:19:18  fabiankeil
  *    Silence bogus compiler warning.
  *
@@ -630,7 +633,6 @@ static int unknown_method(const char *method)
  * Parameters  :
  *          1  :  req = HTTP request line to break down
  *          2  :  http = pointer to the http structure to hold elements
- *          3  :  csp = Current client state (buffers, headers, etc...)
  *
  * Returns     :  JB_ERR_OK on success
  *                JB_ERR_MEMORY on out of memory
@@ -638,9 +640,7 @@ static int unknown_method(const char *method)
  *                                  or >100 domains deep.
  *
  *********************************************************************/
-jb_err parse_http_request(const char *req,
-                          struct http_request *http,
-                          const struct client_state *csp)
+jb_err parse_http_request(const char *req, struct http_request *http)
 {
    char *buf;
    char *v[10]; /* XXX: Why 10? We should only need three. */
diff --git a/urlmatch.h b/urlmatch.h
index 10edcba8..483a0bc7 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.11 2008/05/04 13:30:55 fabiankeil Exp $"
+#define URLMATCH_H_VERSION "$Id: urlmatch.h,v 1.12 2008/05/04 16:18:32 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/urlmatch.h,v $
@@ -35,6 +35,10 @@
  *
  * Revisions   :
  *    $Log: urlmatch.h,v $
+ *    Revision 1.12  2008/05/04 16:18:32  fabiankeil
+ *    Provide parse_http_url() with a third parameter to specify
+ *    whether or not URLs without protocol are acceptable.
+ *
  *    Revision 1.11  2008/05/04 13:30:55  fabiankeil
  *    Streamline parse_http_url()'s prototype.
  *
@@ -97,9 +101,7 @@ extern "C" {
 
 extern void free_http_request(struct http_request *http);
 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_request(const char *req, struct http_request *http);
 extern jb_err parse_http_url(const char *url,
                              struct http_request *http,
                              int require_protocol);