adamdebreceni commented on a change in pull request #1218:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1218#discussion_r758995929



##########
File path: libminifi/src/io/tls/TLSSocket.cpp
##########
@@ -434,9 +434,9 @@ size_t TLSSocket::read(uint8_t *buf, size_t buflen) {
       const auto ssl_read_size = gsl::narrow<int>(std::min(buflen, 
gsl::narrow<size_t>(std::numeric_limits<int>::max())));
       status = SSL_read(fd_ssl, buf, ssl_read_size);
       sslStatus = SSL_get_error(fd_ssl, status);
-    } while (status < 0 && sslStatus == SSL_ERROR_WANT_READ);
+    } while (status <= 0 && sslStatus == SSL_ERROR_WANT_READ);

Review comment:
       I found no connection between the result of `SSL_read` and if retry is 
possible, from 
[openssl](https://www.openssl.org/docs/man1.1.1/man3/SSL_read.html) regarding 
the return value:
   
   > Old documentation indicated a difference between 0 and -1, and that -1 was 
retryable. You should instead call SSL_get_error() to find out if it's 
retryable.
   
   it does not even seem specify that a return value of '0' indicates no more 
data, just that <= 0 is a failure state




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to