summaryrefslogtreecommitdiff
path: root/src/utils/timed_events.hpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-04-17 14:45:19 +0200
committerlouiz’ <louiz@louiz.org>2017-04-17 14:47:21 +0200
commit32384047537ed7c63cf3099b247777ed6035af49 (patch)
treee9a1277d0e567b794fbcc9b37663c6b90240714a /src/utils/timed_events.hpp
parentdc5ad49b4011bb637373c6088efaf219fed4a016 (diff)
downloadbiboumi-32384047537ed7c63cf3099b247777ed6035af49.tar.gz
biboumi-32384047537ed7c63cf3099b247777ed6035af49.tar.bz2
biboumi-32384047537ed7c63cf3099b247777ed6035af49.tar.xz
biboumi-32384047537ed7c63cf3099b247777ed6035af49.zip
Avoid adding more that one “XMPP reconnection” timed event at the same time
Fix a semblance of infinite and busy loop, that could occur if biboumi’s poller is woken up multiple times while the XMPP server is not reachable.
Diffstat (limited to 'src/utils/timed_events.hpp')
-rw-r--r--src/utils/timed_events.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils/timed_events.hpp b/src/utils/timed_events.hpp
index 393b38d..fa0fc50 100644
--- a/src/utils/timed_events.hpp
+++ b/src/utils/timed_events.hpp
@@ -125,6 +125,11 @@ public:
* Return the number of managed events.
*/
std::size_t size() const;
+ /**
+ * Return a pointer to the first event with the given name. If none
+ * is found, returns nullptr.
+ */
+ const TimedEvent* find_event(const std::string& name) const;
private:
std::vector<TimedEvent> events;