From 2dfb99506142f2d59bcc0e0fa7db6b19a3c75d43 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 7 Oct 2024 00:13:02 -0700 Subject: Integer sign extension bug in socket.c. It turns out that for now this results in early wakeups, due to another bug in the aio framework. But when that bug is fixed, this bug will lead to hangs when redialing. --- src/core/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/socket.c') diff --git a/src/core/socket.c b/src/core/socket.c index e501a2da..c4e16f70 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -1485,8 +1485,8 @@ dialer_timer_start_locked(nni_dialer *d) // This algorithm may lead to slight biases because we don't // have a statistically perfect distribution with the modulo of // the random number, but this really doesn't matter. - nni_sleep_aio( - back_off ? (int) nni_random() % back_off : 0, &d->d_tmo_aio); + nni_sleep_aio(back_off ? (nng_duration) (nni_random() % back_off) : 0, + &d->d_tmo_aio); } void -- cgit v1.2.3-70-g09d2