zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] meszibalu commented on a change in pull request #973: ZOOKEEPER-3420 - Fix compatibility issue in C client recv_buffer()
Date Fri, 02 Aug 2019 12:14:13 GMT
meszibalu commented on a change in pull request #973: ZOOKEEPER-3420 - Fix compatibility issue
in C client recv_buffer() 
URL: https://github.com/apache/zookeeper/pull/973#discussion_r307668488
 
 

 ##########
 File path: zookeeper-client/zookeeper-client-c/src/zookeeper.c
 ##########
 @@ -1655,6 +1655,8 @@ static int recv_buffer(zhandle_t *zh, buffer_list_t *buff)
          * old server sends 40 bytes to finish connection handshake,
          * while we're expecting 41 (1 byte for read-only mode data) */
         if (buff == &zh->primer_buffer && rc == buff->len - 1) ++rc;
+        if (buff == &zh->primer_buffer &&
+                buff->curr_offset + rc == buff->len + sizeof(buff->len) - 1) ++rc;
 
 Review comment:
   I would write `off + rc == buff->len - 1` (because `off` is decreased by `sizeof(buff->len)`
in line 1650).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message