commit | 0afd4ee7ea0b01ac4bc2f69eb26a402166d7804a | [log] [tgz] |
---|---|---|
author | Murtadha Hubail <mhubail@apache.org> | Sat Apr 02 01:05:55 2022 +0300 |
committer | Murtadha Hubail <mhubail@apache.org> | Fri Apr 01 22:51:09 2022 +0000 |
tree | 0aee2f063ca0813de1f52b78819de9e2ec5b78ac | |
parent | 2636846ce9bc738b874f5b69fb3a2cf767e2932d [diff] |
[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 <ali.al.solaiman@gmail.com> Tested-by: Murtadha Hubail <mhubail@apache.org>
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 8162e0a..b38f0aa 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 @@ 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());