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

Unified Diff: net/quic/crypto/quic_crypto_client_config.cc

Issue 431483002: QUIC - Added separate error condition for invalid expiry seconds and (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added histogram to track how expired server config is Created 6 years, 5 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/quic_crypto_client_config.cc
diff --git a/net/quic/crypto/quic_crypto_client_config.cc b/net/quic/crypto/quic_crypto_client_config.cc
index 93b11ef4f02cbff300a5c3cacd5822ad74748d66..d00e67677df1c62763bf662f04d2c9ed28a8dc51 100644
--- a/net/quic/crypto/quic_crypto_client_config.cc
+++ b/net/quic/crypto/quic_crypto_client_config.cc
@@ -40,6 +40,7 @@ enum ServerConfigState {
SERVER_CONFIG_INVALID = 1,
SERVER_CONFIG_CORRUPTED = 2,
SERVER_CONFIG_EXPIRED = 3,
+ SERVER_CONFIG_INVALID_EXPIRY_SECONDS = 4,
wtc 2014/08/04 23:36:30 Nit: this can be shortened to "SERVER_CONFIG_INVAL
ramant (doing other things) 2014/08/05 22:07:25 Done.
// NOTE: Add new server config states only immediately above this line. Make
// sure to update the QuicServerConfigState enum in
@@ -87,8 +88,14 @@ bool QuicCryptoClientConfig::CachedState::IsComplete(QuicWallTime now) const {
}
uint64 expiry_seconds;
- if (scfg->GetUint64(kEXPY, &expiry_seconds) != QUIC_NO_ERROR ||
- now.ToUNIXSeconds() >= expiry_seconds) {
+ if (scfg->GetUint64(kEXPY, &expiry_seconds) != QUIC_NO_ERROR) {
+ RecordServerConfigState(SERVER_CONFIG_INVALID_EXPIRY_SECONDS);
+ return false;
+ }
+ if (now.ToUNIXSeconds() >= expiry_seconds) {
+ UMA_HISTOGRAM_TIMES(
+ "Net.QuicClientHelloServerConfig.HowExpired",
+ base::TimeDelta::FromSeconds(now.ToUNIXSeconds() - expiry_seconds));
RecordServerConfigState(SERVER_CONFIG_EXPIRED);
return false;
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698