From 32384047537ed7c63cf3099b247777ed6035af49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Mon, 17 Apr 2017 14:45:19 +0200 Subject: =?UTF-8?q?Avoid=20adding=20more=20that=20one=20=E2=80=9CXMPP=20re?= =?UTF-8?q?connection=E2=80=9D=20timed=20event=20at=20the=20same=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/utils/timed_events.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/utils/timed_events.hpp') 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 events; -- cgit v1.2.3