The below patch has implemented support for response wrapping in HTTP/0.9
transcoder, similar to what is already performed in HTTP/3.
1e144c488c612092067e07f18618482c64d33d17
BUG/MINOR: hq-interop: support response buffer wrapping
However, some bits were incorrectly written and the transcoding would
not be able to handle all of the wrapping data in one pass, despite no
crash possible. This patch fixes these, so that a wrapping response can
be handled in a single pass by the HTTP/0.9 transcoder if there is
enough room in the output HTX buffer.
This should fix github issue #3430.
This should be backported up to 3.3.
struct htx_sl *sl;
struct buffer *htx_buf;
const unsigned int flags = HTX_SL_F_VER_11|HTX_SL_F_XFER_LEN;
- size_t to_copy = b_contig_data(b, 0);
+ size_t to_copy = b_data(b);
size_t htx_sent = 0;
uint32_t htx_space;
char *head;
fin = 0;
}
- if (b_head(b) + to_copy > b_wrap(b)) {
+ if (head + to_copy > b_wrap(b)) {
size_t contig = b_wrap(b) - head;
htx_sent = htx_add_data(htx, ist2(b_head(b), contig));
if (htx_sent < contig) {