diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 977df6a02..189221137 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -24,7 +24,7 @@ jobs: run: cd build && ctest --output-on-failure - name: Upload report - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} yml: ./.codecov.yml diff --git a/src/core/aio.c b/src/core/aio.c index 27ec6d9c9..1c7e41d16 100644 --- a/src/core/aio.c +++ b/src/core/aio.c @@ -755,12 +755,13 @@ nni_sleep_aio(nng_duration ms, nng_aio *aio) default: // If the timeout on the aio is shorter than our sleep time, // then let it still wake up early, but with NNG_ETIMEDOUT. - if (ms > aio->a_timeout) { + if ((ms == NNG_DURATION_INFINITE) || (ms > aio->a_timeout)) { aio->a_expire_ok = false; ms = aio->a_timeout; } } - aio->a_expire = nni_clock() + ms; + aio->a_expire = + ms == NNG_DURATION_INFINITE ? NNI_TIME_NEVER : nni_clock() + ms; if ((rv = nni_aio_schedule(aio, nni_sleep_cancel, NULL)) != 0) { nni_aio_finish_error(aio, rv); diff --git a/src/core/socket.c b/src/core/socket.c index e501a2da2..c4e16f709 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 diff --git a/src/sp/transport.c b/src/sp/transport.c index 1d895c828..973be40b0 100644 --- a/src/sp/transport.c +++ b/src/sp/transport.c @@ -63,6 +63,9 @@ extern void nni_sp_tcp_register(void); #ifdef NNG_TRANSPORT_TLS extern void nni_sp_tls_register(void); #endif +#ifdef NNG_TRANSPORT_UDP +extern void nni_sp_udp_register(void); +#endif #ifdef NNG_TRANSPORT_WS extern void nni_sp_ws_register(void); #endif @@ -91,6 +94,9 @@ nni_sp_tran_sys_init(void) #ifdef NNG_TRANSPORT_TLS nni_sp_tls_register(); #endif +#ifdef NNG_TRANSPORT_UDP + nni_sp_udp_register(); +#endif #ifdef NNG_TRANSPORT_WS nni_sp_ws_register(); #endif