Skip to content
  • Michal Koutný's avatar
    bus: Fix timeout restarts · 52960039
    Michal Koutný authored
    The code counting pending fds relied on restart of timeouts when they are
    enabled. This patch adds function that ensures that such enabled timeouts
    have their timekeeping data reset (and not only when timeout is
    registered into event loop processing).
    
    When timeouts weren't reset, they'd fire at rather random and mainly
    incorrect moments leading to interruption of connections of dbus-daemon.
    
    Every time we reset the interval, we also need to re-enable the timeout
    and mark its end time to be recalculated by the event loop, so combine
    the old set_enabled(TRUE) with set_interval() as a new restart() method.
    This leaves all the set_enabled() calls having a FALSE parameter, so
    remove the parameter and rename the method to disable().
    
    [smcv: fix minor coding style issues]
    [smcv: replace set_reenabled()/set_interval() pair with restart()]
    [smcv: replace set_enabled(FALSE) with disable()]
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95619
    Signed-off-by: Simon McVittie <simon.mcvitti...
    52960039