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

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

Issue 342863005: QUIC - Record reject reasons for CHLO message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: separated histograms.xml changes into a separate CL Created 6 years, 6 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 | « net/quic/crypto/quic_crypto_client_config.h ('k') | net/quic/crypto/quic_crypto_client_config_test.cc » ('j') | no next file with comments »
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 b37befea03e661e50600e9ec3b5b2136cac00d8d..8426c2c8b27ce42a82bc5a578db9cae8c2c47000 100644
--- a/net/quic/crypto/quic_crypto_client_config.cc
+++ b/net/quic/crypto/quic_crypto_client_config.cc
@@ -4,6 +4,7 @@
#include "net/quic/crypto/quic_crypto_client_config.h"
+#include "base/metrics/sparse_histogram.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "net/quic/crypto/cert_compressor.h"
@@ -592,16 +593,56 @@ QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
COMPILE_ASSERT(sizeof(QuicTag) == sizeof(uint32), header_out_of_sync);
if (rej.GetTaglist(kRREJ, &reject_reasons,
&num_reject_reasons) == QUIC_NO_ERROR) {
-#if defined(DEBUG)
+ uint32 packed_error = 0;
for (size_t i = 0; i < num_reject_reasons; ++i) {
- DVLOG(1) << "Reasons for rejection: " << reject_reasons[i];
+ HandshakeFailureReason reason =
+ static_cast<HandshakeFailureReason>(reject_reasons[i]);
+ packed_error |= RejectReasonToPackedError(reason);
}
-#endif
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicClientHelloRejectReasons",
+ packed_error);
}
return QUIC_NO_ERROR;
}
+uint32 QuicCryptoClientConfig::RejectReasonToPackedError(
Mark P 2014/06/24 18:25:49 Please explicitly comment that because these numbe
ramant (doing other things) 2014/06/24 18:39:21 Done.
+ HandshakeFailureReason reason) {
+ switch (reason) {
+ case HANDSHAKE_OK:
+ return 0;
+ case CLIENT_NONCE_UNKNOWN_FAILURE:
+ return 1u << 5;
+ case CLIENT_NONCE_INVALID_FAILURE:
+ return 2u << 5;
+ case SERVER_NONCE_INVALID_FAILURE:
+ return 1u << 10;
+ case SERVER_NONCE_DECRYPTION_FAILURE:
+ return 2u << 10;
+ case SERVER_NONCE_NOT_UNIQUE_FAILURE:
+ return 3u << 10;
+ case SERVER_CONFIG_INCHOATE_HELLO_FAILURE:
+ return 1u << 15;
+ case SERVER_CONFIG_UNKNOWN_CONFIG_FAILURE:
+ return 2u << 15;
+ case SOURCE_ADDRESS_TOKEN_INVALID_FAILURE:
+ return 1u << 20;
+ case SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE:
+ return 2u << 20;
+ case SOURCE_ADDRESS_TOKEN_PARSE_FAILURE:
+ return 3u << 20;
+ case SOURCE_ADDRESS_TOKEN_DIFFERENT_IP_ADDRESS_FAILURE:
+ return 4u << 20;
+ case SOURCE_ADDRESS_TOKEN_CLOCK_SKEW_FAILURE:
+ return 5u << 20;
+ case SOURCE_ADDRESS_TOKEN_EXPIRED_FAILURE:
+ return 6u << 20;
+ default:
+ NOTREACHED();
+ return 1u << 31;
+ }
+}
+
QuicErrorCode QuicCryptoClientConfig::ProcessServerHello(
const CryptoHandshakeMessage& server_hello,
QuicConnectionId connection_id,
« no previous file with comments | « net/quic/crypto/quic_crypto_client_config.h ('k') | net/quic/crypto/quic_crypto_client_config_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698