BUG/MINOR: http-fetch: only defrag HTX message with payload when fetching body
In smp_fetch_body() and smp_fetch_body_param(), the defragmentation was
performed as soon as the HTX message was fragmented or unordered, or when
its free space was wrapping, without checking if the message had a payload.
In practice, it means a full HTX defragmentation was done for any bodyless
request or response when the HTX message was fragmented, which may happen
for instance after a header removal.
Now, the defragmentation is only performed if the message contains payload,
i.e. if the tail block type is higher than or equal to HTX_BLK_DATA. It is
not a strict check, but it is a cheap one, and messages with a single DATA
block never require a defragmentation anyway, since a single DATA block is
always contiguous.
This bug was introduced in 3.4 with the commit
ee309bafc ("MINOR:
http-fetch: Use pointer to HTX DATA block when retrieving HTX body"). It
must be backported as far as 3.4.