Adding support for LOG_LEVEL_CGI
[privoxy.git] / parsers.c
index decf1dd..1d705db 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.20 2001/07/30 22:08:36 jongfoster Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.22 2001/09/10 10:58:53 oes Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -41,6 +41,13 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.20 2001/07/30 22:08:36 jongfoster
  *
  * Revisions   :
  *    $Log: parsers.c,v $
+ *    Revision 1.22  2001/09/10 10:58:53  oes
+ *    Silenced compiler warnings
+ *
+ *    Revision 1.21  2001/07/31 14:46:00  oes
+ *     - Persistant connections now suppressed
+ *     - sed() no longer appends empty header to csp->headers
+ *
  *    Revision 1.20  2001/07/30 22:08:36  jongfoster
  *    Tidying up #defines:
  *    - All feature #defines are now of the form FEATURE_xxx
@@ -83,7 +90,7 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.20 2001/07/30 22:08:36 jongfoster
  *    CRLF -> LF
  *
  *    Revision 1.11  2001/05/29 20:11:19  joergs
- *    '/* inside comment' warning removed.
+ *    '/ * inside comment' warning removed.
  *
  *    Revision 1.10  2001/05/29 09:50:24  jongfoster
  *    Unified blocklist/imagelist/permissionslist.
@@ -555,7 +562,7 @@ void free_http_request(struct http_request *http)
  *********************************************************************/
 void parse_http_request(char *req, struct http_request *http, struct client_state *csp)
 {
-   char *buf, *v[10], *url, *p;
+   char *buf, *v[10], *url, *p, *save_url;
    int n;
 
    memset(http, '\0', sizeof(*http));
@@ -595,6 +602,7 @@ void parse_http_request(char *req, struct http_request *http, struct client_stat
          url            = v[1];
          http->ver      = strdup(v[2]);
 
+        save_url = url;
          if (strncmpic(url, "http://",  7) == 0)
          {
             url += 7;
@@ -610,7 +618,7 @@ void parse_http_request(char *req, struct http_request *http, struct client_stat
 
          if (url)
          {
-            if (p = strchr(url, '/'))
+            if ((p = strchr(url, '/')))
             {
                http->path = strdup(p);
                *p = '\0';
@@ -628,7 +636,9 @@ void parse_http_request(char *req, struct http_request *http, struct client_stat
                /* Even repair cmd in case we're just forwarding. Boy are we nice ;-)  */
                freez(http->cmd);
                http->cmd = strsav(http->cmd, http->gpc);
-               http->cmd = strsav(http->cmd, " / ");
+               http->cmd = strsav(http->cmd, " ");
+               http->cmd = strsav(http->cmd, save_url);
+               http->cmd = strsav(http->cmd, "/ ");
                http->cmd = strsav(http->cmd, http->ver);
             }
          }