server_http(): Make the HTTP reason phrase optional again
authorFabian Keil <fk@fabiankeil.de>
Sat, 18 Oct 2014 11:24:34 +0000 (11:24 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sat, 18 Oct 2014 11:24:34 +0000 (11:24 +0000)
There are still servers around that that don't set one
and Privoxy doesn't really need it anyway.

parsers.c

index 3f5c626..8b1a7a7 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.291 2014/07/25 11:56:54 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.292 2014/07/25 11:57:17 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -3865,15 +3865,21 @@ static jb_err server_http(struct client_state *csp, char **header)
    {
       p++;
       reason_phrase = strchr(p, ' ');
    {
       p++;
       reason_phrase = strchr(p, ' ');
-      if (reason_phrase != NULL)
-      {
-         reason_phrase++;
-      }
    }
 
    }
 
-   if ((reason_phrase == NULL) || (reason_phrase[0] == '\0') ||
-      (3 != sscanf(*header, "HTTP/%u.%u %u", &major_version,
-         &minor_version, &(csp->http->status))))
+   if (reason_phrase != NULL)
+   {
+      reason_phrase++;
+   }
+   else
+   {
+      log_error(LOG_LEVEL_ERROR,
+         "Response line lacks reason phrase: %s", *header);
+      reason_phrase="";
+   }
+
+   if (3 != sscanf(*header, "HTTP/%u.%u %u", &major_version,
+         &minor_version, &(csp->http->status)))
    {
       log_error(LOG_LEVEL_ERROR,
          "Failed to parse the response line: %s", *header);
    {
       log_error(LOG_LEVEL_ERROR,
          "Failed to parse the response line: %s", *header);