Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added EAGAIN handling in SslSocket::doRead/doWrite() methods #241

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions source/extensions/transport_sockets/tls/ssl_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ Network::IoResult SslSocket::doRead(Buffer::Instance& read_buffer) {
break;
}
FALLTHRU;
case SSL_ERROR_SSL:
// If EAGAIN treat it as if it's SSL_ERROR_WANT_READ
if (errno == EAGAIN) {
ENVOY_CONN_LOG(debug, "errno:{}:{}", callbacks_->connection(), errno,
Envoy::errorDetails(errno));
break;
}
// fall through for other errors
case SSL_ERROR_WANT_WRITE:
// Renegotiation has started. We don't handle renegotiation so just fall through.
default:
Expand Down Expand Up @@ -327,6 +335,15 @@ Network::IoResult SslSocket::doWrite(Buffer::Instance& write_buffer, bool end_st
case SSL_ERROR_WANT_WRITE:
bytes_to_retry_ = bytes_to_write;
break;
case SSL_ERROR_SSL:
// If EAGAIN treat it as if it's SSL_ERROR_WANT_WRITE
if (errno == EAGAIN) {
ENVOY_CONN_LOG(debug, "errno:{}:{}", callbacks_->connection(), errno,
Envoy::errorDetails(errno));
bytes_to_retry_ = bytes_to_write;
break;
}
// fall through for other errors
case SSL_ERROR_WANT_READ:
// Renegotiation has started. We don't handle renegotiation so just fall through.
default:
Expand Down