From b4489636cad7a155638a93b02604b3d68460e09c Mon Sep 17 00:00:00 2001 From: Edouard Tisserant Date: Thu, 20 Apr 2017 16:42:01 +0200 Subject: [PATCH] ENGINE-187 added remaining time return when timeout interrupted by message - untested, not even built --- src/org_pEp_jniadapter_AbstractEngine.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/org_pEp_jniadapter_AbstractEngine.cc b/src/org_pEp_jniadapter_AbstractEngine.cc index 45f74f2..85ffcf1 100644 --- a/src/org_pEp_jniadapter_AbstractEngine.cc +++ b/src/org_pEp_jniadapter_AbstractEngine.cc @@ -299,6 +299,15 @@ extern "C" { } } + if(timeout && *timeout != 0){ + // put back remaining time in timeout + now = time(NULL); + if(now < end) + *timeout = end - now; + else + *timeout = 0; + } + msg = queue->front(); queue->pop_front(); return msg;