Since the commit
e99253b70 ("BUG/MINOR: mux-h1: properly handle NOOP
blocks and track EOM emission"), RAW_DATA blocks found in DONE state on
the backend side are only skipped if the end of the request was sent,
the H1S_F_EOM_SENT flag being set. But this flag was never set for a
CONNECT request. In h1_make_eoh(), the CONNECT case is handled before the
EOM flag is tested, even if the EOH block carries the EOM flag, which is
always the case for a CONNECT request received from an H1 or an H2
client. So when a CONNECT was rejected by the server, early tunnel data
still pending in the request buffer were rejected with a processing
error instead of being silently skipped. It was a regression of the
commit
04456142e ("BUG/MINOR: mux-h1: Discard pending raw data after a
tunnel rejection").
Now, the H1S_F_EOM_SENT flag is set for a CONNECT request when the EOH
block carries the EOM flag.
This patch must be backported to 3.5.
if (!chunk_memcat(&outbuf, "\r\n", 2))
goto full;
/* a CONNECT request was sent. Output processing is now blocked
- * waiting the server response.
+ * waiting the server response. The request ends at its headers.
+ * If the EOH block carries the EOM flag, the end of the message
+ * was reached and must be tracked: tunneled data may follow and
+ * must be skipped if the tunnel is rejected.
*/
+ if (blk->flags & HTX_BLK_FL_EOM)
+ h1s->flags |= H1S_F_EOM_SENT;
h1m->state = H1_MSG_DONE;
h1s->flags |= H1S_F_TX_BLK;
TRACE_STATE("CONNECT request waiting for tunnel mode", H1_EV_TX_DATA|H1_EV_H1S_BLK, h1c->conn, h1s);