You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by nk...@apache.org on 2020/01/28 22:09:14 UTC

[zookeeper] branch branch-3.5 updated: ZOOKEEPER-1105: wait for server response in C client zookeeper_close - ADDENDUM

This is an automated email from the ASF dual-hosted git repository.

nkalmar pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/branch-3.5 by this push:
     new 33f98a2  ZOOKEEPER-1105: wait for server response in C client zookeeper_close - ADDENDUM
33f98a2 is described below

commit 33f98a215abeb52825fc76ddaf8d867c200ae4a4
Author: Mate Szalay-Beko <sz...@gmail.com>
AuthorDate: Tue Jan 28 23:09:02 2020 +0100

    ZOOKEEPER-1105: wait for server response in C client zookeeper_close - ADDENDUM
    
    On the branch-3.5 the socket is represented a bit differently (as the SSL support
    in ZOOKEEPER-2122 was not backported to branch-3.5 yet) so we had to fix the
    code to be compatible with the old branch.
    
    I compiled the code and tested the C client with a real 3.5.5 server. When I used
    the patched client, the warnings disappeared.
    
    Author: Mate Szalay-Beko <sz...@gmail.com>
    
    Reviewers: Norbert Kalmar <nk...@apache.org>
    
    Closes #1236 from symat/ZOOKEEPER-1105-branch-3.5
---
 zookeeper-client/zookeeper-client-c/src/zookeeper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/zookeeper-client/zookeeper-client-c/src/zookeeper.c b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
index ec26641..04cfae2 100644
--- a/zookeeper-client/zookeeper-client-c/src/zookeeper.c
+++ b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
@@ -3269,13 +3269,13 @@ int wait_for_session_to_be_closed(zhandle_t *zh, int timeout_ms)
     }
 
 #ifndef WIN32
-    fd_s[0].fd = zh->fd->sock;
+    fd_s[0].fd = zh->fd;
     fd_s[0].events = POLLIN;
     ret = poll(fd_s, 1, timeout_ms);
 #else
     FD_ZERO(&rfds);
     FD_SET(zh->fd->sock , &rfds);
-    ret = select(zh->fd->sock + 1, &rfds, NULL, NULL, &waittime);
+    ret = select((int)(zh->fd)+1, &rfds, NULL, NULL, &waittime);
 #endif
 
     if (ret == 0){