Manually add the changes from the last p-config.sgml update.
[privoxy.git] / parsers.c
index 9aae353..c2020c7 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.207 2009/08/20 15:27:03 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.209 2009/09/06 14:11:06 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -1774,6 +1774,7 @@ static jb_err get_content_length(const char *header, unsigned long long *length)
    assert(header[14] == ':');
 
 #ifdef _WIN32
+   assert(sizeof(unsigned long long) > 4);
    if (1 != sscanf(header+14, ": %I64u", length))
 #else
    if (1 != sscanf(header+14, ": %llu", length))
@@ -3810,6 +3811,17 @@ static jb_err server_set_cookie(struct client_state *csp, char **header)
          {
             char *expiration_date = cur_tag + 8; /* Skip "[Ee]xpires=" */
 
+            if ((expiration_date[0] == '"')
+             && (expiration_date[1] != '\0'))
+            {
+               /*
+                * Skip quotation mark. RFC 2109 10.1.2 seems to hint
+                * that the expiration date isn't supposed to be quoted,
+                * but some servers do it anyway.
+                */
+               expiration_date++;
+            }
+
             /* Did we detect the date properly? */
             if (JB_ERR_OK != parse_header_time(expiration_date, &cookie_time))
             {