Skip to content

Commit 958ef45

Browse files
committed
MINOR: mux_quic: only reset idle timeout for FE side
1 parent 70b05a8 commit 958ef45

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/mux_quic.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ static forceinline void qcc_reset_idle_start(struct qcc *qcc)
252252
qcc->idle_start = now_ms;
253253
}
254254

255+
/* Return true if the mux timeout should be armed. */
256+
static inline int qcc_may_expire(struct qcc *qcc)
257+
{
258+
return !qcc->nb_sc;
259+
}
260+
255261
/* Decrement <qcc> sc. */
256262
static forceinline void qcc_rm_sc(struct qcc *qcc)
257263
{
@@ -261,7 +267,7 @@ static forceinline void qcc_rm_sc(struct qcc *qcc)
261267
/* Reset qcc idle start for http-keep-alive timeout. Timeout will be
262268
* refreshed after this on stream detach.
263269
*/
264-
if (!qcc->nb_sc && !qcc->nb_hreq)
270+
if (!conn_is_back(qcc->conn) && qcc_may_expire(qcc) && !qcc->nb_hreq)
265271
qcc_reset_idle_start(qcc);
266272
}
267273

@@ -274,7 +280,7 @@ static forceinline void qcc_rm_hreq(struct qcc *qcc)
274280
/* Reset qcc idle start for http-keep-alive timeout. Timeout will be
275281
* refreshed after this on I/O handler.
276282
*/
277-
if (!qcc->nb_sc && !qcc->nb_hreq)
283+
if (!conn_is_back(qcc->conn) && qcc_may_expire(qcc) && !qcc->nb_hreq)
278284
qcc_reset_idle_start(qcc);
279285
}
280286

@@ -301,12 +307,6 @@ static inline int qcc_is_dead(const struct qcc *qcc)
301307
return 0;
302308
}
303309

304-
/* Return true if the mux timeout should be armed. */
305-
static inline int qcc_may_expire(struct qcc *qcc)
306-
{
307-
return !qcc->nb_sc;
308-
}
309-
310310
/* Refresh the timeout on <qcc> if needed depending on its state. */
311311
static void qcc_refresh_timeout(struct qcc *qcc)
312312
{
@@ -2139,7 +2139,7 @@ int qcc_recv_max_stream_data(struct qcc *qcc, uint64_t id, uint64_t max)
21392139
}
21402140
}
21412141

2142-
if (qcc_may_expire(qcc) && !qcc->nb_hreq)
2142+
if (!conn_is_back(qcc->conn) && qcc_may_expire(qcc) && !qcc->nb_hreq)
21432143
qcc_refresh_timeout(qcc);
21442144

21452145
TRACE_LEAVE(QMUX_EV_QCC_RECV, qcc->conn);
@@ -2380,7 +2380,7 @@ int qcc_recv_stop_sending(struct qcc *qcc, uint64_t id, uint64_t err)
23802380
*/
23812381
qcc_reset_stream(qcs, err, 0);
23822382

2383-
if (qcc_may_expire(qcc) && !qcc->nb_hreq)
2383+
if (!conn_is_back(qcc->conn) && qcc_may_expire(qcc) && !qcc->nb_hreq)
23842384
qcc_refresh_timeout(qcc);
23852385

23862386
out:

0 commit comments

Comments
 (0)