mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-03-06 15:41:36 +01:00
MINOR: quic: Ensure PTO timer is not set in the past
Wakeup asap the timer task when setting its timer in the past. Take also the opportunity of this patch to make simplify quic_pto_pktns(): calling tick_first() is useless here to compare <lpto> with <tmp_pto>.
This commit is contained in:
parent
59e6bcdcea
commit
5757b4a50e
@ -128,7 +128,7 @@ static inline struct quic_pktns *quic_pto_pktns(struct quic_conn *qc,
|
||||
unsigned int *pto)
|
||||
{
|
||||
int i;
|
||||
unsigned int duration, lpto, time_of_last_eliciting;
|
||||
unsigned int duration, lpto;
|
||||
struct quic_loss *ql = &qc->path->loss;
|
||||
struct quic_pktns *pktns, *p;
|
||||
|
||||
@ -170,9 +170,7 @@ static inline struct quic_pktns *quic_pto_pktns(struct quic_conn *qc,
|
||||
}
|
||||
|
||||
p = &qc->pktns[i];
|
||||
time_of_last_eliciting = p->tx.time_of_last_eliciting;
|
||||
tmp_pto =
|
||||
tick_first(lpto, tick_add(time_of_last_eliciting, duration));
|
||||
tmp_pto = tick_add(p->tx.time_of_last_eliciting, duration);
|
||||
if (!tick_isset(lpto) || tmp_pto < lpto) {
|
||||
lpto = tmp_pto;
|
||||
pktns = p;
|
||||
|
||||
@ -646,8 +646,12 @@ static inline void qc_set_timer(struct quic_conn *qc)
|
||||
if (tick_isset(pto))
|
||||
qc->timer = pto;
|
||||
out:
|
||||
if (qc->timer_task && qc->timer != TICK_ETERNITY)
|
||||
task_schedule(qc->timer_task, qc->timer);
|
||||
if (qc->timer_task && qc->timer != TICK_ETERNITY) {
|
||||
if (tick_is_expired(qc->timer, now_ms))
|
||||
task_wakeup(qc->timer_task, TASK_WOKEN_MSG);
|
||||
else
|
||||
task_schedule(qc->timer_task, qc->timer);
|
||||
}
|
||||
TRACE_LEAVE(QUIC_EV_CONN_STIMER, qc, pktns);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user