Index: net/spdy/buffered_spdy_framer.cc |
diff --git a/net/spdy/buffered_spdy_framer.cc b/net/spdy/buffered_spdy_framer.cc |
index 2fa15b8b9b860c2582e6ec1fb8cfc508af023bfa..ec6c078f40fff83e9cc72f0ae67587d428a5c932 100644 |
--- a/net/spdy/buffered_spdy_framer.cc |
+++ b/net/spdy/buffered_spdy_framer.cc |
@@ -226,7 +226,22 @@ void BufferedSpdyFramer::OnRstStream(SpdyStreamId stream_id, |
} |
void BufferedSpdyFramer::OnGoAway(SpdyStreamId last_accepted_stream_id, |
SpdyGoAwayStatus status) { |
- visitor_->OnGoAway(last_accepted_stream_id, status); |
+ DCHECK(!go_away_fields_.get()); |
eroman
2015/10/06 17:19:41
nit: you can omit the .get()
Bence
2015/10/07 15:18:27
Done.
|
+ go_away_fields_.reset(new GoAwayFields()); |
+ go_away_fields_->last_accepted_stream_id = last_accepted_stream_id; |
+ go_away_fields_->status = status; |
+} |
+ |
+bool BufferedSpdyFramer::OnGoAwayFrameData(const char* goaway_data, |
+ size_t len) { |
+ if (len > 0) { |
eroman
2015/10/06 17:19:41
I assume the contract is that len=0 once all the d
Bence
2015/10/07 15:18:27
Correct. It is documented at https://code.google.
|
+ go_away_fields_->debug_data.append(goaway_data, len); |
eroman
2015/10/06 17:19:41
Should there be a safety-net to prevent unbounded
Bence
2015/10/07 15:18:27
Yes, there should be, especially because buffering
|
+ return true; |
+ } |
+ visitor_->OnGoAway(go_away_fields_->last_accepted_stream_id, |
+ go_away_fields_->status, go_away_fields_->debug_data); |
+ go_away_fields_.reset(nullptr); |
eroman
2015/10/06 17:19:41
nit: I have generally seen nullptr omitted (has de
Bence
2015/10/07 15:18:27
Done.
Bence
2015/10/07 15:18:27
Done.
|
+ return true; |
} |
void BufferedSpdyFramer::OnWindowUpdate(SpdyStreamId stream_id, |
@@ -354,8 +369,9 @@ SpdyFrame* BufferedSpdyFramer::CreatePingFrame(SpdyPingId unique_id, |
// TODO(jgraettinger): Eliminate uses of this method (prefer SpdyGoAwayIR). |
eroman
2015/10/06 17:19:41
Is extending this function orthogonal to this comm
|
SpdyFrame* BufferedSpdyFramer::CreateGoAway( |
SpdyStreamId last_accepted_stream_id, |
- SpdyGoAwayStatus status) const { |
- SpdyGoAwayIR go_ir(last_accepted_stream_id, status, ""); |
+ SpdyGoAwayStatus status, |
+ base::StringPiece debug_data) const { |
+ SpdyGoAwayIR go_ir(last_accepted_stream_id, status, debug_data); |
return spdy_framer_.SerializeGoAway(go_ir); |
} |