BSecureSocket: fix read error handling

The current documentation
(https://www.openssl.org/docs/man1.1.1/man3/SSL_read.html) says that
SSL_read returning 0 should be handled as an error. So, let's do that.

Change-Id: I6781826ea700b6e597fd2d444fd96a1a5270c6cf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3620
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
This commit is contained in:
Adrien Destugues 2021-01-10 18:07:21 +01:00 committed by Stephan Aßmus
parent 1ccfdb2bd5
commit 7b661b559e

View File

@ -540,7 +540,7 @@ BSecureSocket::Read(void* buffer, size_t size)
int retry;
do {
bytesRead = SSL_read(fPrivate->fSSL, buffer, size);
if (bytesRead >= 0)
if (bytesRead > 0)
return bytesRead;
if (errno != EINTR) {