From b3a2f8837c06e73232dadcefc1505851988402bc Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 7 Sep 2019 23:27:29 +0900 Subject: [PATCH] Avoid setting 0 to repeat field --- src/h2load_quic.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/h2load_quic.cc b/src/h2load_quic.cc index 984b0bd9..c2414762 100644 --- a/src/h2load_quic.cc +++ b/src/h2load_quic.cc @@ -552,8 +552,8 @@ int Client::quic_pkt_timeout() { void Client::quic_restart_pkt_timer() { auto expiry = ngtcp2_conn_get_expiry(quic.conn); auto now = timestamp(worker->loop); - auto t = expiry < now ? 1e-9 - : static_cast(expiry - now) / NGTCP2_SECONDS; + auto t = expiry > now ? static_cast(expiry - now) / NGTCP2_SECONDS + : 1e-9; quic.pkt_timer.repeat = t; ev_timer_again(worker->loop, &quic.pkt_timer); }