From 29d7b32813cd72575ddf59ecadeb95397c26c73e Mon Sep 17 00:00:00 2001 From: Pierre Phaneuf Date: Tue, 27 Apr 2010 22:25:59 -0400 Subject: [PATCH] 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 --- http.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/http.c b/http.c index 960074cf..3c3e99af 100644 --- a/http.c +++ b/http.c @@ -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;