BUG/MINOR: proto-htx: Consider a XFER_LEN message as chunked by default

An HTX message with a known body length is now considered by default as
chunked. It means the header "content-length" must be found to consider it as a
non-chunked message. Before, it was the reverse, the message was considered with
a content length by default. But it is a bug for HTTP/2 messages. There is no
chunked transfer encoding in HTTP/2 but internally messages without content
length are considered as chunked. It eases HTTP/1 <-> HTTP/2 conversions.

This patch must be backported to 1.9.
This commit is contained in:
Christopher Faulet 2019-02-18 11:35:02 +01:00
parent fd74267264
commit 834eee7928
1 changed files with 2 additions and 2 deletions

View File

@ -312,7 +312,7 @@ int htx_wait_for_request(struct stream *s, struct channel *req, int an_bit)
if (sl->flags & HTX_SL_F_VER_11)
msg->flags |= HTTP_MSGF_VER_11;
msg->flags |= HTTP_MSGF_XFER_LEN;
msg->flags |= ((sl->flags & HTX_SL_F_CHNK) ? HTTP_MSGF_TE_CHNK : HTTP_MSGF_CNT_LEN);
msg->flags |= ((sl->flags & HTX_SL_F_CLEN) ? HTTP_MSGF_CNT_LEN : HTTP_MSGF_TE_CHNK);
if (sl->flags & HTX_SL_F_BODYLESS)
msg->flags |= HTTP_MSGF_BODYLESS;
@ -1625,7 +1625,7 @@ int htx_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
msg->flags |= HTTP_MSGF_VER_11;
if (sl->flags & HTX_SL_F_XFER_LEN) {
msg->flags |= HTTP_MSGF_XFER_LEN;
msg->flags |= ((sl->flags & HTX_SL_F_CHNK) ? HTTP_MSGF_TE_CHNK : HTTP_MSGF_CNT_LEN);
msg->flags |= ((sl->flags & HTX_SL_F_CLEN) ? HTTP_MSGF_CNT_LEN : HTTP_MSGF_TE_CHNK);
if (sl->flags & HTX_SL_F_BODYLESS)
msg->flags |= HTTP_MSGF_BODYLESS;
}