mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-16 07:45:23 -04:00
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:
parent
ae6ece02f6
commit
29d7b32813
5
http.c
5
http.c
@ -1230,14 +1230,13 @@ evhttp_parse_response_line(struct evhttp_request *req, char *line)
|
|||||||
{
|
{
|
||||||
char *protocol;
|
char *protocol;
|
||||||
char *number;
|
char *number;
|
||||||
char *readable;
|
char *readable = "";
|
||||||
|
|
||||||
protocol = strsep(&line, " ");
|
protocol = strsep(&line, " ");
|
||||||
if (line == NULL)
|
if (line == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
number = strsep(&line, " ");
|
number = strsep(&line, " ");
|
||||||
if (line == NULL)
|
if (line != NULL)
|
||||||
return (-1);
|
|
||||||
readable = line;
|
readable = line;
|
||||||
|
|
||||||
if (strcmp(protocol, "HTTP/1.0") == 0) {
|
if (strcmp(protocol, "HTTP/1.0") == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user