[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 03/04: Fixed: do not enforce "close" connection if reply
From: |
gnunet |
Subject: |
[libmicrohttpd] 03/04: Fixed: do not enforce "close" connection if reply has no body and size is unknown |
Date: |
Tue, 17 Aug 2021 20:38:35 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit cc29f300ab768ac5f0c328858e785a87253fa912
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Aug 17 21:33:58 2021 +0300
Fixed: do not enforce "close" connection if reply has no body and
size is unknown
---
src/microhttpd/connection.c | 48 +++++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 23 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 1e309620..dfa315e1 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1617,31 +1617,33 @@ setup_reply_properties (struct MHD_Connection
*connection)
else
c->rp_props.send_reply_body = false;
- if ( (c->rp_props.use_reply_body_headers) &&
- ((MHD_SIZE_UNKNOWN == r->total_size) ||
- (0 != (r->flags_auto & MHD_RAF_HAS_TRANS_ENC_CHUNKED))) )
- { /* Chunked reply encoding is needed if possible */
-
- /* Check whether chunked encoding is supported by the client */
- if (! MHD_IS_HTTP_VER_1_1_COMPAT (c->http_ver))
- use_chunked = false;
- /* Check whether chunked encoding is allowed for the reply */
- else if (0 != (r->flags & (MHD_RF_HTTP_VERSION_1_0_ONLY
- | MHD_RF_HTTP_VERSION_1_0_RESPONSE)))
- use_chunked = false;
- /* TODO: Use chunked for HTTP/1.1 non-Keep-Alive */
- else if (0 != (r->flags_auto & MHD_RAF_HAS_TRANS_ENC_CHUNKED))
- use_chunked = true;
- else if (! use_keepalive)
- use_chunked = false;
+ if (c->rp_props.use_reply_body_headers)
+ {
+ if ((MHD_SIZE_UNKNOWN == r->total_size) ||
+ (0 != (r->flags_auto & MHD_RAF_HAS_TRANS_ENC_CHUNKED)))
+ { /* Chunked reply encoding is needed if possible */
+
+ /* Check whether chunked encoding is supported by the client */
+ if (! MHD_IS_HTTP_VER_1_1_COMPAT (c->http_ver))
+ use_chunked = false;
+ /* Check whether chunked encoding is allowed for the reply */
+ else if (0 != (r->flags & (MHD_RF_HTTP_VERSION_1_0_ONLY
+ | MHD_RF_HTTP_VERSION_1_0_RESPONSE)))
+ use_chunked = false;
+ /* TODO: Use chunked for HTTP/1.1 non-Keep-Alive */
+ else if (0 != (r->flags_auto & MHD_RAF_HAS_TRANS_ENC_CHUNKED))
+ use_chunked = true;
+ else if (! use_keepalive)
+ use_chunked = false;
+ else
+ use_chunked = true;
+ }
else
- use_chunked = true;
- }
- else
- use_chunked = false;
+ use_chunked = false;
- if ( (MHD_SIZE_UNKNOWN == r->total_size) && ! use_chunked)
- use_keepalive = false; /* End of the stream is indicated by closure */
+ if ( (MHD_SIZE_UNKNOWN == r->total_size) && ! use_chunked)
+ use_keepalive = false; /* End of the stream is indicated by closure */
+ }
c->rp_props.chunked = use_chunked;
c->rp_props.set = true;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.