In http_wait_for_msg_body(), all the payload was considered as received
when the tail block of the HTX message was of a type greater than
HTX_BLK_DATA, to detect the trailers. But since the commit
221c40bbf
("MINOR: htx: Add a noop block to carry the EOM flag on an empty
message"), a NOOP block may be found anywhere in the message and its type
is greater than HTX_BLK_DATA. So a NOOP block without the EOM flag at the
end of the message stopped the wait, the rules being evaluated on a
partial payload. For now, such block can only be produced by the
HTTPMessage:unset_eom() Lua function.
Now, only TLR and EOT blocks are considered.
This patch must be backported to 3.5.
}
/* Now we're are waiting for the payload. We just need to know if all
- * data have been received or if the buffer is full.
+ * data have been received or if the buffer is full. All data were
+ * received if the end of the message was reached or if the trailers
+ * were received. Note a NOOP block may be found anywhere in the
+ * message, so it must not be considered here.
*/
- if (htx_msg_ended(htx) || htx_get_tail_type(htx) > HTX_BLK_DATA)
+ if (htx_msg_ended(htx) ||
+ htx_get_tail_type(htx) == HTX_BLK_TLR || htx_get_tail_type(htx) == HTX_BLK_EOT)
goto end; /* all data received */
if (bytes) {