Author: kgiusti
Date: Wed Nov 14 20:12:34 2012
New Revision: 1409365

URL: http://svn.apache.org/viewvc?rev=1409365&view=rev
Log:
PROTON-111: fix driver timeout calculation

Modified:
    qpid/proton/trunk/proton-c/src/driver.c

Modified: qpid/proton/trunk/proton-c/src/driver.c
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/driver.c?rev=1409365&r1=1409364&r2=1409365&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/driver.c (original)
+++ qpid/proton/trunk/proton-c/src/driver.c Wed Nov 14 20:12:34 2012
@@ -731,7 +731,10 @@ int pn_driver_wait_2(pn_driver_t *d, int
 {
   if (d->wakeup) {
     pn_timestamp_t now = pn_driver_now(d);
-    timeout = (now >= d->wakeup) ? 0 : pn_min(timeout, d->wakeup - now);
+    if (now >= d->wakeup)
+      timeout = 0;
+    else
+      timeout = (timeout < 0) ? d->wakeup-now : pn_min(timeout, d->wakeup - 
now);
   }
   if (poll(d->fds, d->nfds, d->closed_count > 0 ? 0 : timeout) == -1)
     return pn_error_from_errno(d->error, "poll");



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to