Skip to content

Commit 7be0e21

Browse files
committed
MEDIUM: mux_quic: preserve connection while stream requests are present
1 parent 02111fc commit 7be0e21

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

include/haproxy/mux_quic.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ static inline void qcs_wait_http_req(struct qcs *qcs)
116116
* restriction is needed here.
117117
*/
118118
LIST_APPEND(&qcc->opening_list, &qcs->el_opening);
119+
120+
/* QC_SF_HREQ_RECV must be set once for a stream. Else, nb_hreq counter
121+
* will be incorrect for the connection.
122+
*/
123+
BUG_ON_HOT(qcs->flags & QC_SF_HREQ_RECV);
124+
qcs->flags |= QC_SF_HREQ_RECV;
125+
++qcc->nb_hreq;
119126
}
120127

121128
void qcc_show_quic(struct qcc *qcc);

src/mux_quic.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ static forceinline void qcc_rm_hreq(struct qcc *qcc)
286286

287287
static inline int qcc_is_dead(const struct qcc *qcc)
288288
{
289-
/* Maintain connection if stream endpoints are still active. */
290-
if (qcc->nb_sc)
289+
/* Maintain connection if there is still request streams active. */
290+
if (qcc->nb_hreq)
291291
return 0;
292292

293293
/* Connection considered dead if either :
@@ -299,8 +299,8 @@ static inline int qcc_is_dead(const struct qcc *qcc)
299299
*/
300300
if (qcc->flags & (QC_CF_ERR_CONN|QC_CF_ERRL_DONE) ||
301301
!qcc->task ||
302-
(!conn_is_back(qcc->conn) && !qcc->nb_hreq && qcc->app_st == QCC_APP_ST_SHUT) ||
303-
(conn_is_back(qcc->conn) && !qcc->nb_hreq && (qcc->flags & QC_CF_CONN_SHUT))) {
302+
(!conn_is_back(qcc->conn) && qcc->app_st == QCC_APP_ST_SHUT) ||
303+
(conn_is_back(qcc->conn) && (qcc->flags & QC_CF_CONN_SHUT))) {
304304
return 1;
305305
}
306306

@@ -1019,13 +1019,7 @@ int qcs_attach_sc(struct qcs *qcs, struct buffer *buf, char fin)
10191019
return -1;
10201020
}
10211021

1022-
/* QC_SF_HREQ_RECV must be set once for a stream. Else, nb_hreq counter
1023-
* will be incorrect for the connection.
1024-
*/
1025-
BUG_ON_HOT(qcs->flags & QC_SF_HREQ_RECV);
1026-
qcs->flags |= QC_SF_HREQ_RECV;
10271022
++qcc->nb_sc;
1028-
++qcc->nb_hreq;
10291023
++qcc->tot_sc;
10301024

10311025
/* TODO duplicated from mux_h2 */

0 commit comments

Comments
 (0)