BSecureSocket: Read and Write should return 0 for closed sockets.

This commit is contained in:
Hamish Morrison
2013-02-07 18:42:39 +00:00
parent f00edeb7e3
commit 02deec6403
+2 -2
View File
@@ -141,7 +141,7 @@ BSecureSocket::Read(void* buffer, size_t size)
return B_ERROR; return B_ERROR;
int bytesRead = SSL_read(fPrivate->fSSL, buffer, size); int bytesRead = SSL_read(fPrivate->fSSL, buffer, size);
if (bytesRead > 0) if (bytesRead >= 0)
return bytesRead; return bytesRead;
// TODO: translate SSL error codes! // TODO: translate SSL error codes!
@@ -156,7 +156,7 @@ BSecureSocket::Write(const void* buffer, size_t size)
return B_ERROR; return B_ERROR;
int bytesWritten = SSL_write(fPrivate->fSSL, buffer, size); int bytesWritten = SSL_write(fPrivate->fSSL, buffer, size);
if (bytesWritten > 0) if (bytesWritten >= 0)
return bytesWritten; return bytesWritten;
// TODO: translate SSL error codes! // TODO: translate SSL error codes!