diff options
author | jgraettinger@chromium.org <jgraettinger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-25 05:42:05 +0000 |
---|---|---|
committer | jgraettinger@chromium.org <jgraettinger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-25 05:42:05 +0000 |
commit | 53669f6067d653bd701a145e0bde26edfa074605 (patch) | |
tree | 6e0cb51106b8ee6a1a421ac24f51794474527b07 /net/spdy/spdy_framer.cc | |
parent | 1214b853e84214f7e908a61272eefebe82b7303d (diff) | |
download | chromium_src-53669f6067d653bd701a145e0bde26edfa074605.zip chromium_src-53669f6067d653bd701a145e0bde26edfa074605.tar.gz chromium_src-53669f6067d653bd701a145e0bde26edfa074605.tar.bz2 |
Implements the ACK flag for SPDY4/HTTP2 PING frames
This lands server change 61378132 by birenroy.
Also update SpdySession, BufferedSpdyFramer, etc to accept and pass
the |is_ack| flag.
BUG=345769
Review URL: https://codereview.chromium.org/169283012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_framer.cc')
-rw-r--r-- | net/spdy/spdy_framer.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc index 4024010..f2ec0f3 100644 --- a/net/spdy/spdy_framer.cc +++ b/net/spdy/spdy_framer.cc @@ -755,7 +755,8 @@ void SpdyFramer::ProcessControlFrameHeader(uint16 control_frame_type_field) { case PING: if (current_frame_length_ != GetPingSize()) { set_error(SPDY_INVALID_CONTROL_FRAME); - } else if (current_frame_flags_ != 0) { + } else if ((protocol_version() < 4 && current_frame_flags_ != 0) || + (current_frame_flags_ & ~PING_FLAG_ACK)) { set_error(SPDY_INVALID_CONTROL_FRAME_FLAGS); } break; @@ -1481,6 +1482,8 @@ size_t SpdyFramer::ProcessControlFramePayload(const char* data, size_t len) { break; case PING: { SpdyPingId id = 0; + bool is_ack = + spdy_version_ >= 4 && (current_frame_flags_ & PING_FLAG_ACK); bool successful_read = true; if (spdy_version_ < 4) { uint32 id32 = 0; @@ -1491,7 +1494,7 @@ size_t SpdyFramer::ProcessControlFramePayload(const char* data, size_t len) { } DCHECK(successful_read); DCHECK(reader.IsDoneReading()); - visitor_->OnPing(id); + visitor_->OnPing(id, is_ack); } break; case WINDOW_UPDATE: { @@ -1954,7 +1957,11 @@ SpdySerializedFrame* SpdyFramer::SerializePing(const SpdyPingIR& ping) const { builder.WriteControlFrameHeader(*this, PING, kNoFlags); builder.WriteUInt32(static_cast<uint32>(ping.id())); } else { - builder.WriteFramePrefix(*this, PING, 0, 0); + uint8 flags = 0; + if (ping.is_ack()) { + flags |= PING_FLAG_ACK; + } + builder.WriteFramePrefix(*this, PING, flags, 0); builder.WriteUInt64(ping.id()); } DCHECK_EQ(GetPingSize(), builder.length()); |