event/TimeoutMonitor: eliminate support for periodic events

No caller needs this.  Fixes use-after-free after returning from
Client::OnTimeout().
This commit is contained in:
Max Kellermann
2013-04-08 23:14:07 +02:00
parent dca1115196
commit 98cbc0ea79
8 changed files with 17 additions and 27 deletions

View File

@@ -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