aboutsummaryrefslogtreecommitdiffstats
path: root/src/InotifyQueue.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-04-08 23:14:07 +0200
committerMax Kellermann <max@duempel.org>2013-04-08 23:14:07 +0200
commit98cbc0ea79ce5bea637f7bd7ebe94e698cd818a0 (patch)
treea514f72181ce9b3158b25a1c5778c4477062dc06 /src/InotifyQueue.cxx
parentdca111519627813608807b60b98f3d5133880120 (diff)
downloadmpd-98cbc0ea79ce5bea637f7bd7ebe94e698cd818a0.tar.gz
mpd-98cbc0ea79ce5bea637f7bd7ebe94e698cd818a0.tar.xz
mpd-98cbc0ea79ce5bea637f7bd7ebe94e698cd818a0.zip
event/TimeoutMonitor: eliminate support for periodic events
No caller needs this. Fixes use-after-free after returning from Client::OnTimeout().
Diffstat (limited to 'src/InotifyQueue.cxx')
-rw-r--r--src/InotifyQueue.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/InotifyQueue.cxx b/src/InotifyQueue.cxx
index 3212f95f9..419135dae 100644
--- a/src/InotifyQueue.cxx
+++ b/src/InotifyQueue.cxx
@@ -38,7 +38,7 @@ enum {
INOTIFY_UPDATE_DELAY_S = 5,
};
-bool
+void
InotifyQueue::OnTimeout()
{
unsigned id;
@@ -47,17 +47,16 @@ InotifyQueue::OnTimeout()
const char *uri_utf8 = queue.front().c_str();
id = update_enqueue(uri_utf8, false);
- if (id == 0)
+ if (id == 0) {
/* retry later */
- return true;
+ ScheduleSeconds(INOTIFY_UPDATE_DELAY_S);
+ return;
+ }
g_debug("updating '%s' job=%u", uri_utf8, id);
queue.pop_front();
}
-
- /* done, remove the timer event by returning false */
- return false;
}
static bool