Commit 155601d4 authored by rjshade@google.com's avatar rjshade@google.com

Log QuicGoAwayFrames and QuicPingFrames, sent and received, in net log.

BUG=

Review URL: https://codereview.chromium.org/338933003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277861 0039d316-1c4b-4281-b951-d872f2087c98
parent b32c1a10
......@@ -1460,6 +1460,28 @@ EVENT_TYPE(QUIC_SESSION_BLOCKED_FRAME_RECEIVED)
// }
EVENT_TYPE(QUIC_SESSION_BLOCKED_FRAME_SENT)
// Session received a GOAWAY frame.
// {
// "quic_error": <QuicErrorCode in the frame>,
// "last_good_stream_id": <Last correctly received stream id by the server>,
// "reason_phrase": <Prose justifying go-away request>,
// }
EVENT_TYPE(QUIC_SESSION_GOAWAY_FRAME_RECEIVED)
// Session sent a GOAWAY frame.
// {
// "quic_error": <QuicErrorCode in the frame>,
// "last_good_stream_id": <Last correctly received stream id by the server>,
// "reason_phrase": <Prose justifying go-away request>,
// }
EVENT_TYPE(QUIC_SESSION_GOAWAY_FRAME_SENT)
// Session received a PING frame.
EVENT_TYPE(QUIC_SESSION_PING_FRAME_RECEIVED)
// Session sent a PING frame.
EVENT_TYPE(QUIC_SESSION_PING_FRAME_SENT)
// Session received a STOP_WAITING frame.
// {
// "sent_info": <Details of packet sent by the peer>
......
......@@ -739,6 +739,9 @@ bool QuicConnection::OnConnectionCloseFrame(
bool QuicConnection::OnGoAwayFrame(const QuicGoAwayFrame& frame) {
DCHECK(connected_);
if (debug_visitor_) {
debug_visitor_->OnGoAwayFrame(frame);
}
DVLOG(1) << ENDPOINT << "Go away received with error "
<< QuicUtils::ErrorToString(frame.error_code)
<< " and reason:" << frame.reason_phrase;
......
......@@ -160,6 +160,9 @@ class NET_EXPORT_PRIVATE QuicConnectionDebugVisitor
// Called when a Ping has been parsed.
virtual void OnPingFrame(const QuicPingFrame& frame) {}
// Called when a GoAway has been parsed.
virtual void OnGoAwayFrame(const QuicGoAwayFrame& frame) {}
// Called when a RstStreamFrame has been parsed.
virtual void OnRstStreamFrame(const QuicRstStreamFrame& frame) {}
......
......@@ -195,6 +195,16 @@ base::Value* NetLogQuicBlockedFrameCallback(
return dict;
}
base::Value* NetLogQuicGoAwayFrameCallback(
const QuicGoAwayFrame* frame,
NetLog::LogLevel /* log_level */) {
base::DictionaryValue* dict = new base::DictionaryValue();
dict->SetInteger("quic_error", frame->error_code);
dict->SetInteger("last_good_stream_id", frame->last_good_stream_id);
dict->SetString("reason_phrase", frame->reason_phrase);
return dict;
}
base::Value* NetLogQuicStopWaitingFrameCallback(
const QuicStopWaitingFrame* frame,
NetLog::LogLevel /* log_level */) {
......@@ -386,6 +396,10 @@ void QuicConnectionLogger::OnFrameAddedToPacket(const QuicFrame& frame) {
frame.connection_close_frame));
break;
case GOAWAY_FRAME:
net_log_.AddEvent(
NetLog::TYPE_QUIC_SESSION_GOAWAY_FRAME_SENT,
base::Bind(&NetLogQuicGoAwayFrameCallback,
frame.goaway_frame));
break;
case WINDOW_UPDATE_FRAME:
net_log_.AddEvent(
......@@ -405,6 +419,10 @@ void QuicConnectionLogger::OnFrameAddedToPacket(const QuicFrame& frame) {
base::Bind(&NetLogQuicStopWaitingFrameCallback,
frame.stop_waiting_frame));
break;
case PING_FRAME:
// PingFrame has no contents to log, so just record that it was sent.
net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PING_FRAME_SENT);
break;
default:
DCHECK(false) << "Illegal frame type: " << frame.type;
}
......@@ -578,6 +596,17 @@ void QuicConnectionLogger::OnBlockedFrame(const QuicBlockedFrame& frame) {
base::Bind(&NetLogQuicBlockedFrameCallback, &frame));
}
void QuicConnectionLogger::OnGoAwayFrame(const QuicGoAwayFrame& frame) {
net_log_.AddEvent(
NetLog::TYPE_QUIC_SESSION_GOAWAY_FRAME_RECEIVED,
base::Bind(&NetLogQuicGoAwayFrameCallback, &frame));
}
void QuicConnectionLogger::OnPingFrame(const QuicPingFrame& frame) {
// PingFrame has no contents to log, so just record that it was received.
net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PING_FRAME_RECEIVED);
}
void QuicConnectionLogger::OnPublicResetPacket(
const QuicPublicResetPacket& packet) {
net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PUBLIC_RESET_PACKET_RECEIVED);
......
......@@ -53,6 +53,8 @@ class NET_EXPORT_PRIVATE QuicConnectionLogger
const QuicConnectionCloseFrame& frame) OVERRIDE;
virtual void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) OVERRIDE;
virtual void OnBlockedFrame(const QuicBlockedFrame& frame) OVERRIDE;
virtual void OnGoAwayFrame(const QuicGoAwayFrame& frame) OVERRIDE;
virtual void OnPingFrame(const QuicPingFrame& frame) OVERRIDE;
virtual void OnPublicResetPacket(
const QuicPublicResetPacket& packet) OVERRIDE;
virtual void OnVersionNegotiationPacket(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment