Skip to content

Commit

Permalink
BUG/MEDIUM: mux-quic: ensure timeout server is active for short requests
Browse files Browse the repository at this point in the history
If a small request is received on QUIC MUX frontend, it can be
transmitted directly with the FIN on attach operation. rcv_buf is
skipped by the stream layer. Thus, it is necessary to ensure that there
is similar behavior when FIN is reported either on attach or rcv_buf.

One difference was that se_expect_data() was called only for rcv_buf but
not on attach. This most obvious effect is that stream timeout was
deactivated for this request : client timeout was disabled on EOI but
server one not armed due to previous se_expect_no_data(). This prevents
the early closure of too long requests.

To fix this, add an invokation of se_expect_data() on attach operation.

This bug can simply be detected using httpterm with delay request (for
example /?t=10000) and using smaller client/server timeouts. The bug is
present if the request is not aborted on timeout but instead continue
until its proper HTTP 200 termination.

This has been introduced by the following commit :
  85eabfb
  MEDIUM: mux-quic: Don't expect data from server as long as request is unfinished

This must be backported up to 2.8.
  • Loading branch information
a-denoyelle committed Oct 10, 2024
1 parent 7144e60 commit 232083c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mux_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,13 @@ struct stconn *qcs_attach_sc(struct qcs *qcs, struct buffer *buf, char fin)
BUG_ON_HOT(!LIST_INLIST(&qcs->el_opening));
LIST_DEL_INIT(&qcs->el_opening);

/* rcv_buf may be skipped if request is wholly received on attach.
* Ensure that similar flags are set for FIN both on rcv_buf and here.
*/
if (fin) {
TRACE_STATE("report end-of-input", QMUX_EV_STRM_RECV, qcc->conn, qcs);
se_fl_set(qcs->sd, SE_FL_EOI);
se_expect_data(qcs->sd);
}

/* A QCS can be already locally closed before stream layer
Expand Down

0 comments on commit 232083c

Please sign in to comment.