Commit 96714da5 authored by Michi Mutsuzaki's avatar Michi Mutsuzaki
Browse files

ZOOKEEPER-1756. zookeeper_interest() in C client can return a timeval of 0...

ZOOKEEPER-1756. zookeeper_interest() in C client can return a timeval of 0 (Eric Lindvall via michim)


git-svn-id: https://svn.apache.org/repos/asf/zookeeper/branches/branch-3.4@1551367 13f79535-47bb-0310-9956-ffa450edef68
parent 961d9c98
......@@ -191,6 +191,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-1564. Allow JUnit test build with IBM Java
......
......@@ -1650,13 +1650,15 @@ int zookeeper_interest(zhandle_t *zh, int *fd, int *interest,
// 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(("Sending PING to %s (exceeded idle by %dms)",
// format_current_endpoint_info(zh),-send_to));
int rc=send_ping(zh);
if (rc < 0){
LOG_ERROR(("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(("Sending PING to %s (exceeded idle by %dms)",
// format_current_endpoint_info(zh),-send_to));
int rc=send_ping(zh);
if (rc < 0){
LOG_ERROR(("failed to send PING request (zk retcode=%d)",rc));
return api_epilog(zh,rc);
}
}
send_to = zh->recv_timeout/3;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment