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

dlych pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git

commit 0afd4ee7ea0b01ac4bc2f69eb26a402166d7804a
Author: Murtadha Hubail <[email protected]>
AuthorDate: Sat Apr 2 01:05:55 2022 +0300

    [NO ISSUE][NET] Attempt to Read SSL Sockets Until EOF
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    
    - Since SSL sockets may return 0 as read bytes due to failure
      to decrypt a complete encrypted block, we need to attempt
      to read again until a complete block is decrypted.
    
    Change-Id: Ia48b7f9f1725c40b2ebfac6fe77b3eb42c426de3
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15964
    Reviewed-by: Ali Alsuliman <[email protected]>
    Tested-by: Murtadha Hubail <[email protected]>
---
 .../java/org/apache/asterix/replication/management/NetworkingUtil.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/NetworkingUtil.java
 
b/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/NetworkingUtil.java
index 8162e0af3f..b38f0aa8d3 100644
--- 
a/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/NetworkingUtil.java
+++ 
b/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/NetworkingUtil.java
@@ -49,7 +49,7 @@ public class NetworkingUtil {
         byteBuffer.clear();
         byteBuffer.limit(length);
 
-        while (byteBuffer.remaining() > 0 && socketChannel.read(byteBuffer) > 
0);
+        while (byteBuffer.remaining() > 0 && socketChannel.read(byteBuffer) >= 
0);
 
         if (byteBuffer.remaining() > 0) {
             throw new EOFException("could not read all data from source; 
remaining bytes: " + byteBuffer.remaining());

Reply via email to