Index: net/spdy/spdy_framer.cc |
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc |
index 77aa413a78cf14013d50387e7e2b268c73ef31f2..88a05ea85967912be077675e8602ea1928f61b19 100644 |
--- a/net/spdy/spdy_framer.cc |
+++ b/net/spdy/spdy_framer.cc |
@@ -2416,32 +2416,15 @@ SpdySerializedFrame* SpdyFramer::SerializeSynStream( |
SpdySerializedFrame* SpdyFramer::SerializeSynReply( |
const SpdySynReplyIR& syn_reply) { |
+ DCHECK_GE(SPDY3, protocol_version()); |
uint8 flags = 0; |
if (syn_reply.fin()) { |
flags |= CONTROL_FLAG_FIN; |
} |
- // In SPDY >= 4, SYN_REPLY frames are HEADERS frames, but for now |
- // we never expect to have to overflow into a CONTINUATION frame. |
- if (protocol_version() > SPDY3) { |
- flags |= HEADERS_FLAG_END_HEADERS; |
- } |
// The size of this frame, including variable-length name-value block. |
- size_t size = GetSynReplyMinimumSize(); |
- |
- string hpack_encoding; |
- if (protocol_version() > SPDY3) { |
- if (enable_compression_) { |
- GetHpackEncoder()->EncodeHeaderSet( |
- syn_reply.name_value_block(), &hpack_encoding); |
- } else { |
- GetHpackEncoder()->EncodeHeaderSetWithoutCompression( |
- syn_reply.name_value_block(), &hpack_encoding); |
- } |
- size += hpack_encoding.size(); |
- } else { |
- size += GetSerializedLength(syn_reply.name_value_block()); |
- } |
+ const size_t size = GetSynReplyMinimumSize() + |
+ GetSerializedLength(syn_reply.name_value_block()); |
SpdyFrameBuilder builder(size, protocol_version()); |
if (protocol_version() <= SPDY3) { |
@@ -2457,17 +2440,11 @@ SpdySerializedFrame* SpdyFramer::SerializeSynReply( |
builder.WriteUInt16(0); // Unused. |
} |
DCHECK_EQ(GetSynReplyMinimumSize(), builder.length()); |
- if (protocol_version() > SPDY3) { |
- builder.WriteBytes(&hpack_encoding[0], hpack_encoding.size()); |
- } else { |
- SerializeNameValueBlock(&builder, syn_reply); |
- } |
+ SerializeNameValueBlock(&builder, syn_reply); |
if (debug_visitor_) { |
- const size_t payload_len = protocol_version() > SPDY3 ? |
- hpack_encoding.size() : |
- GetSerializedLength(protocol_version(), |
- &(syn_reply.name_value_block())); |
+ const size_t payload_len = GetSerializedLength( |
+ protocol_version(), &(syn_reply.name_value_block())); |
debug_visitor_->OnSendCompressedFrame(syn_reply.stream_id(), |
SYN_REPLY, |
payload_len, |