It is the same bug than the previous one on the FCGI mux.
When we try to send data to the server and the stream is closed (in error,
in half-closed state or fully closed), remaining data must be drained. This
way the upper stream is able to properly handle the stream close.
However, there was a bug here. The mux claimed to have consumed these data
without draining them from the buffer. The issue was never reported on the
H2 multiplexer. But, in theory, the same than for the FCGI multiplexer is
possible.
Tihs patch must be backported to all supported versions.
done:
if (h2s->st >= H2_SS_HLOC) {
+ struct htx_ret htxret;
+
/* trim any possibly pending data after we close (extra CR-LF,
* unprocessed trailers, abnormal extra data, ...)
*/
- total += count;
- count = 0;
+ htxret = htx_drain(htx, count);
+ total += htxret.ret;
+ count -= htxret.ret;
}
/* RST are sent similarly to frame acks */