Do not abort HTTP requests missing a reason string.

Some (arguably broken) HTTP servers do not put the reason message in their
status line, which causes evhttp to consider the response invalid.

http://sourceforge.net/tracker/?func=detail&aid=2875077&group_id=50884&atid=461322
This commit is contained in:
Pierre Phaneuf 2010-04-27 22:25:59 -04:00
parent ae6ece02f6
commit 29d7b32813

7
http.c
View File

@ -1230,15 +1230,14 @@ evhttp_parse_response_line(struct evhttp_request *req, char *line)
{
char *protocol;
char *number;
char *readable;
char *readable = "";
protocol = strsep(&line, " ");
if (line == NULL)
return (-1);
number = strsep(&line, " ");
if (line == NULL)
return (-1);
readable = line;
if (line != NULL)
readable = line;
if (strcmp(protocol, "HTTP/1.0") == 0) {
req->major = 1;