This is an automated email from the ASF dual-hosted git repository.
maskit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 5ca08cf75f Reduce the number of calls for ERR_clear_error (#11778)
5ca08cf75f is described below
commit 5ca08cf75f95f8f1e63267f6db7ca1a9367bf297
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Thu Sep 19 09:12:31 2024 -0600
Reduce the number of calls for ERR_clear_error (#11778)
Since we check the error only after the loop, clearing error on each
iteration does not make sense.
---
src/iocore/net/SSLNetVConnection.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/iocore/net/SSLNetVConnection.cc
b/src/iocore/net/SSLNetVConnection.cc
index d75c97b42b..dcf222aea7 100644
--- a/src/iocore/net/SSLNetVConnection.cc
+++ b/src/iocore/net/SSLNetVConnection.cc
@@ -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();
@@ -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,