Skip to content

Commit

Permalink
Remove SPDY4 RST_STREAM payload flag remnants.
Browse files Browse the repository at this point in the history
Upstream flag allow_spdy_4_rst_stream_opaque_data has been deprecated.

This lands server change 62210395 by mlavan.

BUG=345769

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254237 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
jgraettinger@chromium.org committed Feb 28, 2014
1 parent 2268249 commit 06b242d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 54 deletions.
33 changes: 2 additions & 31 deletions net/spdy/spdy_framer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1490,33 +1490,6 @@ size_t SpdyFramer::ProcessControlFramePayload(const char* data, size_t len) {

// Use frame-specific handlers.
switch (current_frame_type_) {
case RST_STREAM:
// TODO(jgraettinger): Leaving this here for future, saner patching.
// RST_STREAM is separately handled by ProcessRstStreamFramePayload().
NOTREACHED();
if (false
/*!FLAGS_gfe2_restart_flag_allow_spdy_4_rst_stream_opaque_data*/) {
bool successful_read = true;
if (spdy_version_ < 4) {
successful_read = reader.ReadUInt31(&current_frame_stream_id_);
DCHECK(successful_read);
}
SpdyRstStreamStatus status = RST_STREAM_INVALID;
uint32 status_raw = status;
successful_read = reader.ReadUInt32(&status_raw);
DCHECK(successful_read);
if (status_raw > RST_STREAM_INVALID &&
status_raw < RST_STREAM_NUM_STATUS_CODES) {
status = static_cast<SpdyRstStreamStatus>(status_raw);
} else {
// TODO(hkhalil): Probably best to OnError here, depending on
// our interpretation of the spec. Keeping with existing liberal
// behavior for now.
}
DCHECK(reader.IsDoneReading());
visitor_->OnRstStream(current_frame_stream_id_, status);
}
break;
case PING: {
SpdyPingId id = 0;
bool is_ack =
Expand Down Expand Up @@ -1916,8 +1889,7 @@ SpdySerializedFrame* SpdyFramer::SerializeRstStream(
// commented but left in place to simplify future patching.
// Compute the output buffer size, taking opaque data into account.
uint16 expected_length = GetRstStreamMinimumSize();
if (protocol_version() >= 4 &&
false /*FLAGS_gfe2_restart_flag_allow_spdy_4_rst_stream_opaque_data*/) {
if (protocol_version() >= 4) {
expected_length += rst_stream.description().size();
}
SpdyFrameBuilder builder(expected_length);
Expand All @@ -1933,8 +1905,7 @@ SpdySerializedFrame* SpdyFramer::SerializeRstStream(
builder.WriteUInt32(rst_stream.status());

// In SPDY4 and up, RST_STREAM frames may also specify opaque data.
if (protocol_version() >= 4 && rst_stream.description().size() > 0 &&
false /*FLAGS_gfe2_restart_flag_allow_spdy_4_rst_stream_opaque_data*/) {
if (protocol_version() >= 4 && rst_stream.description().size() > 0) {
builder.WriteBytes(rst_stream.description().data(),
rst_stream.description().size());
}
Expand Down
27 changes: 4 additions & 23 deletions net/spdy/spdy_framer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1078,19 +1078,10 @@ TEST_P(SpdyFramerTest, Basic) {
EXPECT_EQ(1, visitor.headers_frame_count_);
EXPECT_EQ(24, visitor.data_bytes_);

// TODO(jgraettinger): We expect to handle but not emit RST payloads.
if (false /*!FLAGS_gfe2_restart_flag_allow_spdy_4_rst_stream_opaque_data*/ &&
IsSpdy4()) {
// Last rst_stream is an INVALID_CONTROL_FRAME.
EXPECT_EQ(1, visitor.error_count_);
EXPECT_EQ(1, visitor.fin_frame_count_);
} else {
EXPECT_EQ(0, visitor.error_count_);
EXPECT_EQ(2, visitor.fin_frame_count_);
}
EXPECT_EQ(0, visitor.error_count_);
EXPECT_EQ(2, visitor.fin_frame_count_);

if (true /*FLAGS_gfe2_restart_flag_allow_spdy_4_rst_stream_opaque_data*/ &&
IsSpdy4()) {
if (IsSpdy4()) {
base::StringPiece reset_stream = "RESETSTREAM";
EXPECT_EQ(reset_stream, visitor.fin_opaque_data_);
} else {
Expand Down Expand Up @@ -2154,19 +2145,9 @@ TEST_P(SpdyFramerTest, CreateRstStream) {
0x00, 0x00, 0x00, 0x01,
0x52, 0x53, 0x54
};
const unsigned char kV4FrameDataOld[] = {
0x00, 0x0c, 0x03, 0x00,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x01,
};
net::SpdyRstStreamIR rst_stream(1, RST_STREAM_PROTOCOL_ERROR, "RST");
scoped_ptr<SpdyFrame> frame(framer.SerializeRstStream(rst_stream));
// TODO(jgraettinger): We expect to handle but not emit RST payloads.
if (IsSpdy4() &&
true /*!FLAGS_gfe2_restart_flag_allow_spdy_4_rst_stream_opaque_data*/) {
CompareFrame(kDescription, *frame, kV4FrameDataOld,
arraysize(kV4FrameDataOld));
} else if (IsSpdy4()) {
if (IsSpdy4()) {
CompareFrame(kDescription, *frame, kV4FrameData, arraysize(kV4FrameData));
} else {
CompareFrame(kDescription, *frame, kV3FrameData, arraysize(kV3FrameData));
Expand Down

0 comments on commit 06b242d

Please sign in to comment.