wwbmmm commented on code in PR #3316:
URL: https://github.com/apache/brpc/pull/3316#discussion_r3327937589
##########
src/brpc/socket.cpp:
##########
@@ -2146,6 +2154,10 @@ ssize_t Socket::DoRead(size_t size_hint) {
BIO_fd_non_fatal_error(saved_errno) != 0 ||
nr < 0;
PLOG_IF(WARNING, is_fatal_error) << "Fail to read from ssl_fd=" <<
fd();
+ if (is_fatal_error) {
Review Comment:
Why modify this branch?
##########
src/brpc/socket.cpp:
##########
@@ -2133,11 +2133,19 @@ ssize_t Socket::DoRead(size_t size_hint) {
default: {
const unsigned long e = ERR_get_error();
if (nr == 0) {
- // Socket EOF or SSL session EOF
+ if (ssl_error != SSL_ERROR_ZERO_RETURN) {
+ // Unexpected EOF without proper SSL shutdown (close_notify)
+ LOG(WARNING) << "Fail to read from ssl_fd=" << fd()
+ << ": unexpected ssl_error=" << ssl_error;
+ errno = ESSL;
+ return -1;
+ }
+ // Clean SSL shutdown (close_notify received)
} else if (e != 0) {
LOG(WARNING) << "Fail to read from ssl_fd=" << fd()
<< ": " << SSLError(e);
errno = ESSL;
+ return -1;
Review Comment:
Why modify this branch?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]