From a389b8f2f9c55b76fe5a28c3f1fea798ed37aa98 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Mon, 13 Apr 2026 16:11:04 -0400 Subject: Allow packet_stream_reconnect() to cut off a connecting stream. Cleanup timer. Signed-off-by: Andrew Opalach --- src/timer.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/timer.c') diff --git a/src/timer.c b/src/timer.c index c0759cc..1d14a38 100644 --- a/src/timer.c +++ b/src/timer.c @@ -5,7 +5,7 @@ static void timer_callback(struct ev_loop *loop, ev_timer *w, s32 revents) (void)loop; struct nn_timer *timer = (struct nn_timer *)w->data; (void)revents; - if (!timer->disabled) timer->callback(timer->userdata, timer); + timer->callback(timer->userdata, timer); } void nn_timer_init(struct nn_timer *timer, struct nn_event_loop *loop, @@ -15,7 +15,6 @@ void nn_timer_init(struct nn_timer *timer, struct nn_event_loop *loop, timer->callback = callback; timer->userdata = userdata; timer->timer.data = timer; - timer->disabled = false; ev_init_n(&timer->timer, timer_callback); } @@ -26,17 +25,7 @@ void nn_timer_set_repeat(struct nn_timer *timer, nn_os_tstamp repeat) void nn_timer_again(struct nn_timer *timer) { - if (!timer->disabled) ev_timer_again(timer->loop->ev, &timer->timer); -} - -void nn_timer_disable(struct nn_timer *timer) -{ - timer->disabled = true; -} - -void nn_timer_enable(struct nn_timer *timer) -{ - timer->disabled = false; + ev_timer_again(timer->loop->ev, &timer->timer); } void nn_timer_stop(struct nn_timer *timer) -- cgit v1.2.3-101-g0448