swim: do not use ev_timer_start
Appeared that libev changes 'ev_timer.at' field to a remaining time value, and it can't be used as a storage for a timeout. By the same reason ev_timer_start() can't be used to reuse a timer. On the contrary, 'ev_timer.repeat' is not touched by libev, and ev_timer_again() allows to reuse a timer. This patch replaces 'at' with 'repeat' and ev_timer_start() with ev_timer_again(). The bug was not detected by unit tests, because they implement their own event loop and do not change ev_timer.at. Now they do to prevent a regression. Part of #3234
Showing
- src/lib/swim/swim.c 11 additions, 17 deletionssrc/lib/swim/swim.c
- src/lib/swim/swim.h 0 additions, 4 deletionssrc/lib/swim/swim.h
- src/lib/swim/swim_ev.c 6 additions, 0 deletionssrc/lib/swim/swim_ev.c
- src/lib/swim/swim_ev.h 3 additions, 0 deletionssrc/lib/swim/swim_ev.h
- test/unit/swim_test_ev.c 11 additions, 0 deletionstest/unit/swim_test_ev.c
Loading
Please register or sign in to comment