Skip to content

Commit

Permalink
Reduce the number of calls for ERR_clear_error (#11778)
Browse files Browse the repository at this point in the history
Since we check the error only after the loop, clearing error on each iteration does not make sense.
  • Loading branch information
maskit authored Sep 19, 2024
1 parent a3c5cb5 commit 5ca08cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/iocore/net/SSLNetVConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ SSLNetVConnection::load_buffer_and_write(int64_t towrite, MIOBufferAccessor &buf

Dbg(dbg_ctl_ssl, "towrite=%" PRId64, towrite);

ERR_clear_error();
do {
// What is remaining left in the next block?
l = buf.reader()->block_read_avail();
Expand Down Expand Up @@ -2491,7 +2492,6 @@ SSLNetVConnection::_ssl_write_buffer(const void *buf, int64_t nbytes, int64_t &n
if (unlikely(nbytes == 0)) {
return SSL_ERROR_NONE;
}
ERR_clear_error();

int ret;
// If SSL_write_early_data is available, it's probably OpenSSL,
Expand Down

0 comments on commit 5ca08cf

Please sign in to comment.