From 05e7a8fa9082d785ff5a6dd3fffb0545c4fe3717 Mon Sep 17 00:00:00 2001 From: Roker Date: Mon, 5 Nov 2018 09:45:43 +0100 Subject: [PATCH] try_pop_front() returns true on success, not on timeout! Thanks, thomas! --- Adapter.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Adapter.cc b/Adapter.cc index a5c8bf7..881d993 100644 --- a/Adapter.cc +++ b/Adapter.cc @@ -55,9 +55,9 @@ namespace pEp { SYNC_EVENT _retrieve_next_sync_event(void *management, unsigned threshold) { SYNC_EVENT syncEvent = nullptr; - const bool timeout = q.try_pop_front(syncEvent, std::chrono::seconds(threshold)); + const bool success = q.try_pop_front(syncEvent, std::chrono::seconds(threshold)); - if (timeout) + if (!success) return new_sync_timeout_event(); return syncEvent;