Skip to content

Commit 088345b

Browse files
committed
Fixed review comments
1 parent 7ebe8cb commit 088345b

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

doc/admin-guide/logging/formatting.en.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ cqql Client Request Client request header and content length combined,
455455
in bytes.
456456
cqqtl Client Request Same as cqql_, but for the first transaction on a
457457
TLS connection, also includes TLS handshake bytes
458-
received from the client. Note that this metrics
458+
received from the client. Note that this metric
459459
may not always be 100% accurate.
460460
csscl Cached Origin Response Content body length from cached origin response.
461461
csshl Cached Origin Response Header length from cached origin response.

include/iocore/net/TLSBasicSupport.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class TLSBasicSupport
5151
std::string_view get_tls_group() const;
5252
ink_hrtime get_tls_handshake_begin_time() const;
5353
ink_hrtime get_tls_handshake_end_time() const;
54-
bool get_tls_handshake_bytes(uint64_t &bytes_in, uint64_t &bytes_out);
54+
bool get_tls_handshake_bytes(uint64_t &bytes_in, uint64_t &bytes_out) const;
5555

5656
/**
5757
* Returns a certificate that need to be verified.
@@ -103,8 +103,8 @@ class TLSBasicSupport
103103

104104
X509_STORE_CTX *_cert_to_verify = nullptr;
105105

106-
ink_hrtime _tls_handshake_begin_time = 0;
107-
ink_hrtime _tls_handshake_end_time = 0;
108-
uint64_t _tls_handshake_bytes_in = 0;
109-
uint64_t _tls_handshake_bytes_out = 0;
106+
ink_hrtime _tls_handshake_begin_time = 0;
107+
ink_hrtime _tls_handshake_end_time = 0;
108+
mutable uint64_t _tls_handshake_bytes_in = 0;
109+
mutable uint64_t _tls_handshake_bytes_out = 0;
110110
};

src/iocore/net/SSLStats.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ SSLInitializeStatistics()
281281
ssl_rsb.user_agent_version_too_low = Metrics::Counter::createPtr("proxy.process.ssl.user_agent_version_too_low");
282282
ssl_rsb.user_agent_wrong_version = Metrics::Counter::createPtr("proxy.process.ssl.user_agent_wrong_version");
283283
ssl_rsb.tls_handshake_bytes_in_total = Metrics::Counter::createPtr("proxy.process.ssl.total_handshake_bytes_read_in");
284-
ssl_rsb.tls_handshake_bytes_out_total = Metrics::Counter::createPtr("proxy.process.ssl.total_handshake_bytes_write_in");
284+
ssl_rsb.tls_handshake_bytes_out_total = Metrics::Counter::createPtr("proxy.process.ssl.total_handshake_bytes_write_out");
285285

286286
#if defined(OPENSSL_IS_BORINGSSL)
287287
size_t n = SSL_get_all_cipher_names(nullptr, 0);

src/iocore/net/TLSBasicSupport.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ TLSBasicSupport::clear()
7676
this->_tls_handshake_bytes_out = 0;
7777
}
7878

79+
// Returns true only on the first call that reads from the BIOs, so callers
80+
// can distinguish fresh values (for metrics) from cached ones.
7981
bool
80-
TLSBasicSupport::get_tls_handshake_bytes(uint64_t &bytes_in, uint64_t &bytes_out)
82+
TLSBasicSupport::get_tls_handshake_bytes(uint64_t &bytes_in, uint64_t &bytes_out) const
8183
{
8284
if (_tls_handshake_bytes_in > 0 || _tls_handshake_bytes_out > 0) {
8385
bytes_in = _tls_handshake_bytes_in;

0 commit comments

Comments
 (0)