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

Unified Diff: net/quic/quic_client_session.cc

Issue 23532042: Report a more specific QUIC error when reading from the socket fails. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/quic_client_session.h ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_client_session.cc
diff --git a/net/quic/quic_client_session.cc b/net/quic/quic_client_session.cc
index 0fde5b9a085ac09f180e3b99e193a631015d4f93..2980611efe8d67cb01337f6287bffce10045d162 100644
--- a/net/quic/quic_client_session.cc
+++ b/net/quic/quic_client_session.cc
@@ -334,25 +334,26 @@ void QuicClientSession::StartReading() {
void QuicClientSession::CloseSessionOnError(int error) {
UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.CloseSessionOnError", -error);
- CloseSessionOnErrorInner(error);
+ CloseSessionOnErrorInner(error, QUIC_INTERNAL_ERROR);
NotifyFactoryOfSessionClose();
}
-void QuicClientSession::CloseSessionOnErrorInner(int error) {
+void QuicClientSession::CloseSessionOnErrorInner(int net_error,
+ QuicErrorCode quic_error) {
if (!callback_.is_null()) {
- base::ResetAndReturn(&callback_).Run(error);
+ base::ResetAndReturn(&callback_).Run(net_error);
}
while (!streams()->empty()) {
ReliableQuicStream* stream = streams()->begin()->second;
QuicStreamId id = stream->id();
- static_cast<QuicReliableClientStream*>(stream)->OnError(error);
+ static_cast<QuicReliableClientStream*>(stream)->OnError(net_error);
CloseStream(id);
}
net_log_.AddEvent(
NetLog::TYPE_QUIC_SESSION_CLOSE_ON_ERROR,
- NetLog::IntegerCallback("net_error", error));
+ NetLog::IntegerCallback("net_error", net_error));
- connection()->CloseConnection(QUIC_INTERNAL_ERROR, false);
+ connection()->CloseConnection(quic_error, false);
DCHECK(!connection()->connected());
}
@@ -378,7 +379,8 @@ void QuicClientSession::OnReadComplete(int result) {
if (result < 0) {
DLOG(INFO) << "Closing session on read error: " << result;
- CloseSessionOnErrorInner(result);
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.ReadError", -result);
+ CloseSessionOnErrorInner(result, QUIC_PACKET_READ_ERROR);
NotifyFactoryOfSessionCloseLater();
return;
}
« no previous file with comments | « net/quic/quic_client_session.h ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698