]> granicus.if.org Git - libevent/commitdiff
http: remove message in case !Content-Length and Connection!=close
authorAzat Khuzhin <a3at.mail@gmail.com>
Tue, 13 Feb 2018 14:43:02 +0000 (17:43 +0300)
committerAzat Khuzhin <azat@libevent.org>
Sat, 2 Feb 2019 12:13:55 +0000 (15:13 +0300)
Since [1] GET can have body, and hence for every incomming connection it
will print this error.

[1] db483e3b002b33890fc88cadd77f6fd1fccad2d2 ("Allow bodies for
GET/DELETE/OPTIONS/CONNECT")

Noticed-by: BotoX (irc)
Refs: #408
(cherry picked from commit cd57e38c3f77d0f6a718d9c1f2e3ead78a98bd06)

http.c

diff --git a/http.c b/http.c
index 196ddd1d2cc8649f26d008e841de00b877bd0c39..8541fdc109b9508399eddcae01f0c34057d6c711 100644 (file)
--- a/http.c
+++ b/http.c
@@ -2132,10 +2132,6 @@ evhttp_get_body_length(struct evhttp_request *req)
                req->ntoread = -1;
        else if (content_length == NULL &&
            evutil_ascii_strcasecmp(connection, "Close") != 0) {
-               /* Bad combination, we don't know when it will end */
-               event_warnx("%s: we got no content length, but the "
-                   "server wants to keep the connection open: %s.",
-                   __func__, connection);
                req->ntoread = 0;
        } else if (content_length == NULL) {
                req->ntoread = -1;