BUG/MINOR: channel: inject output data at the end of output
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 Jan 2020 09:01:57 +0000 (10:01 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 9 Jan 2020 16:40:55 +0000 (17:40 +0100)
commita96cbaa1e30e23bf91b7a4fb46857b4b2823deea
treefa20cbd10f5a28a59265dac6cfc58b50e25ce740
parent219f7cb9e3eb061103c3c013a6ecf13d38281247
BUG/MINOR: channel: inject output data at the end of output

In co_inject(), data must be inserted at the end of output, not the end of
input. For the record, this function does not take care of input data which are
supposed to not exist. But the caller may reset input data after or before the
call. It is its own choice.

This bug, among other effects, is visible when a redirect is performed on
the response path, on legacy HTTP mode (so for HAProxy < 2.1). The redirect
response is appended after the server response when it should overwrite it.

Thanks to Kevin Zhu <ip0tcp@gmail.com> to report the bug. It must be backported
as far as 1.9.

(cherry picked from commit 584348be636fcc9f41b80ef0fde03c7899d75cd7)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/channel.c