Browse Source

Fixed timeout handling in retrieve_next_sync_msg

JNI-44
Edouard Tisserant 9 years ago
parent
commit
a8d39cecdc
  1. 4
      src/org_pEp_jniadapter_AbstractEngine.cc

4
src/org_pEp_jniadapter_AbstractEngine.cc

@ -276,7 +276,7 @@ extern "C" {
time_t now, end; time_t now, end;
void *msg; void *msg;
if(*timeout == 0){ if(timeout && *timeout != 0){
now = time(NULL); now = time(NULL);
end = now + *timeout; end = now + *timeout;
} }
@ -285,7 +285,7 @@ extern "C" {
// TODO: add blocking dequeue // TODO: add blocking dequeue
usleep(100000); usleep(100000);
if(*timeout == 0){ if(timeout && *timeout != 0){
now = time(NULL); now = time(NULL);
if(now > end) if(now > end)
return NULL; return NULL;

Loading…
Cancel
Save