zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mic...@apache.org
Subject svn commit: r1551366 - in /zookeeper/trunk: CHANGES.txt src/c/src/zookeeper.c
Date Mon, 16 Dec 2013 21:47:21 GMT
Author: michim
Date: Mon Dec 16 21:47:20 2013
New Revision: 1551366

URL: http://svn.apache.org/r1551366
Log:
ZOOKEEPER-1756. zookeeper_interest() in C client can return a timeval of 0 (Eric Lindvall
via michim)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/c/src/zookeeper.c

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1551366&r1=1551365&r2=1551366&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Mon Dec 16 21:47:20 2013
@@ -501,6 +501,9 @@ BUGFIXES:
   ZOOKEEPER-1622. session ids will be negative in the year 2022
   (Eric Newton via phunt)
 
+  ZOOKEEPER-1756. zookeeper_interest() in C client can return a timeval of 0
+  (Eric Lindvall via michim)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

Modified: zookeeper/trunk/src/c/src/zookeeper.c
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/c/src/zookeeper.c?rev=1551366&r1=1551365&r2=1551366&view=diff
==============================================================================
--- zookeeper/trunk/src/c/src/zookeeper.c (original)
+++ zookeeper/trunk/src/c/src/zookeeper.c Mon Dec 16 21:47:20 2013
@@ -2034,13 +2034,15 @@ int zookeeper_interest(zhandle_t *zh, in
         // a PING
         if (zh->state==ZOO_CONNECTED_STATE) {
             send_to = zh->recv_timeout/3 - idle_send;
-            if (send_to <= 0 && zh->sent_requests.head==0) {
-//                LOG_DEBUG(LOGCALLBACK(zh), "Sending PING to %s (exceeded idle by %dms)",
-//                                zoo_get_current_server(zh),-send_to);
-                rc = send_ping(zh);
-                if (rc < 0){
-                    LOG_ERROR(LOGCALLBACK(zh), "failed to send PING request (zk retcode=%d)",rc);
-                    return api_epilog(zh,rc);
+            if (send_to <= 0) {
+                if (zh->sent_requests.head == 0) {
+//                  LOG_DEBUG(LOGCALLBACK(zh), "Sending PING to %s (exceeded idle by %dms)",
+//                            zoo_get_current_server(zh),-send_to);
+                    rc = send_ping(zh);
+                    if (rc < 0) {
+                        LOG_ERROR(LOGCALLBACK(zh), "failed to send PING request (zk retcode=%d)",rc);
+                        return api_epilog(zh,rc);
+                    }
                 }
                 send_to = zh->recv_timeout/3;
             }



Mime
View raw message