Avoid setting 0 to repeat field

This commit is contained in:
Tatsuhiro Tsujikawa 2019-09-07 23:27:29 +09:00
parent 33d2a93294
commit b3a2f8837c
1 changed files with 2 additions and 2 deletions

View File

@ -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<ev_tstamp>(expiry - now) / NGTCP2_SECONDS;
auto t = expiry > now ? static_cast<ev_tstamp>(expiry - now) / NGTCP2_SECONDS
: 1e-9;
quic.pkt_timer.repeat = t;
ev_timer_again(worker->loop, &quic.pkt_timer);
}