From: Fabian Keil Date: Sat, 18 Oct 2014 11:24:34 +0000 (+0000) Subject: server_http(): Make the HTTP reason phrase optional again X-Git-Tag: v_3_0_22~63 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=669e502a39f941fbe1cf1444b611d3ab49a97c4c server_http(): Make the HTTP reason phrase optional again There are still servers around that that don't set one and Privoxy doesn't really need it anyway. --- diff --git a/parsers.c b/parsers.c index 3f5c626f..8b1a7a7a 100644 --- 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 $ @@ -3865,15 +3865,21 @@ static jb_err server_http(struct client_state *csp, char **header) { 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);