http: fix closing HTTP 1.x connection
When the client closes the stream, then underlying HTTP 1.x connection must be terminated in any of the following cases:
- The server uses HTTP version 1.0.
- The server specified the "close" token in the Connection header line of the HTTP response header.
- Fewer bytes than specified in the Content-Length header line of the HTTP response header were read.
- The response body is encoded with chunked encoding and the end of the body has not been reached.
In the first two cases, flag connection_close
will be set. It was
write-only before this patch.
In the third case, the content_length
will be non-zero but not
unknown (UINTMAX_MAX
).
The last case is already handled by the chunked encoding decoder.
Fixes #26084 (closed).