Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1092)

Unified Diff: net/socket/ssl_client_socket_impl.cc

Issue 2625883002: SSLClientSessionCache: Log number of times Lookup is called per Session. (Closed)
Patch Set: reset count on handshake completion; log count from lookup Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/socket/ssl_client_socket_impl.cc
diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket_impl.cc
index 4e3f71311c7c2a4974e2337bc0f583724f3b8a46..4aae5548c7bdf98ac253b72a598b09a03c2cba9b 100644
--- a/net/socket/ssl_client_socket_impl.cc
+++ b/net/socket/ssl_client_socket_impl.cc
@@ -944,8 +944,8 @@ int SSLClientSocketImpl::Init() {
return ERR_UNEXPECTED;
}
- bssl::UniquePtr<SSL_SESSION> session =
- context->session_cache()->Lookup(GetSessionCacheKey());
+ bssl::UniquePtr<SSL_SESSION> session = context->session_cache()->Lookup(
+ GetSessionCacheKey(), &ssl_session_cache_lookup_count_);
if (session)
SSL_set_session(ssl_.get(), session.get());
@@ -1146,6 +1146,15 @@ int SSLClientSocketImpl::DoHandshakeComplete(int result) {
if (result < 0)
return result;
+ if (ssl_session_cache_lookup_count_) {
+ SSLContext::GetInstance()->session_cache()->ResetLookupCount(
+ GetSessionCacheKey(), SSL_get_session(ssl_.get()));
davidben 2017/01/19 20:29:34 Doesn't this want to be reset regardless of whethe
nharper 2017/01/19 21:50:35 Yes, that sounds right. We're modelling the server
+ if (negotiated_protocol_ == kProtoHTTP2 && SSL_session_reused(ssl_.get())) {
+ UMA_HISTOGRAM_EXACT_LINEAR("Net.SSLSessionConcurrentLookupCount",
+ ssl_session_cache_lookup_count_, 20);
davidben 2017/01/19 20:29:34 This should probably have a comment for what's goi
nharper 2017/01/19 21:50:35 Done.
+ }
+ }
+
// DHE is offered on the deprecated cipher fallback and then rejected
// afterwards. This is to aid in diagnosing connection failures because a
// server requires DHE ciphers.

Powered by Google App Engine
This is Rietveld 408576698