patch: bus: Fix timeout restarts 01/116801/2 accepted/tizen/ivi/20170306.102902 accepted/tizen/mobile/20170306.102816 accepted/tizen/tv/20170306.102834 accepted/tizen/wearable/20170306.102849 submit/tizen/20170306.031610
authorsanghyeok.oh <sanghyeok.oh@samsung.com>
Tue, 28 Feb 2017 09:00:42 +0000 (18:00 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Thu, 2 Mar 2017 01:26:20 +0000 (17:26 -0800)
commitffc72625ab9b18f9ff67c16aebc4ad93d4767b6f
treec8d8880856c88d9ff35325714736ba5c58d17097
parent128b0ba7bb678173d251514a975b3aa275dfe77f
patch: bus: Fix timeout restarts

patch from upstream
https://cgit.freedesktop.org/dbus/dbus/commit/?id=529600397bcab47b9bed5da9208c2df05c8b86b4

author Michal Koutn? <mkoutny@suse.com> 2016-05-24 09:14:11 (GMT)
committer Simon McVittie <smcv@debian.org> 2017-02-01 10:42:50 (GMT)
commit 529600397bcab47b9bed5da9208c2df05c8b86b4 (patch)
tree 17e9af27f973a4e0132ee23e405ed7d52fdb0771
parent befd186c0b005f1e1130cb3e4923c689085a8dbc (diff)

bus: Fix timeout restarts
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

Change-Id: Ia80641554800ae09ae22d4615b87eda0697c5f3e
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
bus/connection.c
bus/expirelist.c
dbus/dbus-mainloop.c
dbus/dbus-timeout.c
dbus/dbus-timeout.h