do not set CONN_CLOSE_EMPTY for 1.0 until we reply.

This commit is contained in:
Joris Vink 2018-11-30 22:12:43 +01:00
parent cf2e158773
commit 61b385ae11
1 changed files with 4 additions and 3 deletions

View File

@ -1394,7 +1394,6 @@ http_request_new(struct connection *c, const char *host,
}
flags = HTTP_VERSION_1_0;
c->flags |= CONN_CLOSE_EMPTY;
} else {
flags = HTTP_VERSION_1_1;
}
@ -1853,10 +1852,12 @@ http_response_normal(struct http_request *req, struct connection *c,
version, status, http_status_text(status));
kore_buf_append(header_buf, http_version, http_version_len);
if (c->flags & CONN_CLOSE_EMPTY)
if ((c->flags & CONN_CLOSE_EMPTY) ||
(req->flags & HTTP_VERSION_1_0)) {
connection_close = 1;
else
} else {
connection_close = 0;
}
if (connection_close == 0 && req != NULL) {
if (http_request_header(req, "connection", &conn)) {