mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
MINOR: quic: Simplication for qc_set_timer()
There is no reason to run code for nothing if the timer task has been released when entering qc_set_timer(). Must be backported to 2.7.
This commit is contained in:
parent
dea3298282
commit
dd41a45014
@ -754,6 +754,12 @@ static inline void qc_set_timer(struct quic_conn *qc)
|
||||
TRACE_ENTER(QUIC_EV_CONN_STIMER, qc,
|
||||
NULL, NULL, &qc->path->ifae_pkts);
|
||||
|
||||
pktns = NULL;
|
||||
if (!qc->timer_task) {
|
||||
TRACE_PROTO("already released timer task", QUIC_EV_CONN_STIMER, qc);
|
||||
goto leave;
|
||||
}
|
||||
|
||||
pktns = quic_loss_pktns(qc);
|
||||
if (tick_isset(pktns->tx.loss_time)) {
|
||||
qc->timer = pktns->tx.loss_time;
|
||||
@ -782,19 +788,18 @@ static inline void qc_set_timer(struct quic_conn *qc)
|
||||
if (tick_isset(pto))
|
||||
qc->timer = pto;
|
||||
out:
|
||||
if (qc->timer_task) {
|
||||
if (qc->timer == TICK_ETERNITY) {
|
||||
qc->timer_task->expire = TICK_ETERNITY;
|
||||
}
|
||||
else if (tick_is_expired(qc->timer, now_ms)) {
|
||||
TRACE_DEVEL("wakeup asap timer task", QUIC_EV_CONN_STIMER, qc);
|
||||
task_wakeup(qc->timer_task, TASK_WOKEN_MSG);
|
||||
}
|
||||
else {
|
||||
TRACE_DEVEL("timer task scheduling", QUIC_EV_CONN_STIMER, qc);
|
||||
task_schedule(qc->timer_task, qc->timer);
|
||||
}
|
||||
if (qc->timer == TICK_ETERNITY) {
|
||||
qc->timer_task->expire = TICK_ETERNITY;
|
||||
}
|
||||
else if (tick_is_expired(qc->timer, now_ms)) {
|
||||
TRACE_DEVEL("wakeup asap timer task", QUIC_EV_CONN_STIMER, qc);
|
||||
task_wakeup(qc->timer_task, TASK_WOKEN_MSG);
|
||||
}
|
||||
else {
|
||||
TRACE_DEVEL("timer task scheduling", QUIC_EV_CONN_STIMER, qc);
|
||||
task_schedule(qc->timer_task, qc->timer);
|
||||
}
|
||||
leave:
|
||||
TRACE_LEAVE(QUIC_EV_CONN_STIMER, qc, pktns);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user