From: Fabian Keil <fk@fabiankeil.de>
Date: Fri, 26 Jan 2007 15:33:46 +0000 (+0000)
Subject: Stop filter_header() from unintentionally removing
X-Git-Tag: v_3_0_7~360
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/%22https:/developer-manual/@default-cgi@send-stylesheet?a=commitdiff_plain;h=6b4ef031feb10a11516150ff67f0bc214e0ce3ba;p=privoxy.git

Stop filter_header() from unintentionally removing
empty header lines that were enlisted by the continue
hack.
---

diff --git a/parsers.c b/parsers.c
index 47fc66a4..fdc2f79c 100644
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.83 2007/01/12 15:03:02 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.84 2007/01/24 12:56:52 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -45,6 +45,14 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.83 2007/01/12 15:03:02 fabiankeil
  *
  * Revisions   :
  *    $Log: parsers.c,v $
+ *    Revision 1.84  2007/01/24 12:56:52  fabiankeil
+ *    - Repeat the request URL before logging any headers.
+ *      Makes reading the log easier in case of simultaneous requests.
+ *    - If there are more than one Content-Type headers in one request,
+ *      use the first one and remove the others.
+ *    - Remove "newval" variable in server_content_type().
+ *      It's only used once.
+ *
  *    Revision 1.83  2007/01/12 15:03:02  fabiankeil
  *    Correct a cast, check inflateEnd() exit code
  *    to see if we have to, replace sprintf calls
@@ -1499,7 +1507,12 @@ jb_err filter_header(struct client_state *csp, char **header)
       }
    }
 
-   if ( 0 == size )
+   /*
+    * Additionally checking for hits is important because if
+    * the continue hack is triggered, server headers can
+    * arrive empty to separate multiple heads from each other.
+    */
+   if ((0 == size) && hits)
    {
       log_error(LOG_LEVEL_HEADER, "Removing empty header %s", *header);
       freez(*header);