Index: net/spdy/spdy_framer.cc |
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc |
index bad34035937139b249e01b2f5c73977871b2a539..4049e100f19690be484a625a17e3d6ab5eae6a7b 100644 |
--- a/net/spdy/spdy_framer.cc |
+++ b/net/spdy/spdy_framer.cc |
@@ -2399,8 +2399,7 @@ SpdySerializedFrame* SpdyFramer::SerializeSynStream( |
} |
if (debug_visitor_) { |
- const size_t payload_len = protocol_version() > SPDY3 ? |
- hpack_encoding.size() : |
+ const size_t payload_len = |
GetSerializedLength(protocol_version(), |
&(syn_stream.name_value_block())); |
// SPDY 4 reports this compression as a SYN_STREAM compression. |
@@ -2723,22 +2722,18 @@ SpdyFrame* SpdyFramer::SerializePushPromise( |
size_t size = GetPushPromiseMinimumSize(); |
string hpack_encoding; |
- if (protocol_version() > SPDY3) { |
- if (enable_compression_) { |
- GetHpackEncoder()->EncodeHeaderSet( |
- push_promise.name_value_block(), &hpack_encoding); |
- } else { |
- GetHpackEncoder()->EncodeHeaderSetWithoutCompression( |
- push_promise.name_value_block(), &hpack_encoding); |
- } |
- size += hpack_encoding.size(); |
- if (size > GetControlFrameBufferMaxSize()) { |
- size += GetNumberRequiredContinuationFrames(size) * |
- GetContinuationMinimumSize(); |
- flags &= ~PUSH_PROMISE_FLAG_END_PUSH_PROMISE; |
- } |
+ if (enable_compression_) { |
+ GetHpackEncoder()->EncodeHeaderSet( |
+ push_promise.name_value_block(), &hpack_encoding); |
} else { |
- size += GetSerializedLength(push_promise.name_value_block()); |
+ GetHpackEncoder()->EncodeHeaderSetWithoutCompression( |
+ push_promise.name_value_block(), &hpack_encoding); |
+ } |
+ size += hpack_encoding.size(); |
+ if (size > GetControlFrameBufferMaxSize()) { |
+ size += GetNumberRequiredContinuationFrames(size) * |
+ GetContinuationMinimumSize(); |
+ flags &= ~PUSH_PROMISE_FLAG_END_PUSH_PROMISE; |
} |
SpdyFrameBuilder builder(size, protocol_version()); |
@@ -2749,22 +2744,14 @@ SpdyFrame* SpdyFramer::SerializePushPromise( |
builder.WriteUInt32(push_promise.promised_stream_id()); |
DCHECK_EQ(GetPushPromiseMinimumSize(), builder.length()); |
- if (protocol_version() > SPDY3) { |
- WritePayloadWithContinuation(&builder, |
- hpack_encoding, |
- push_promise.stream_id(), |
- PUSH_PROMISE); |
- } else { |
- SerializeNameValueBlock(&builder, push_promise); |
- } |
+ WritePayloadWithContinuation(&builder, |
+ hpack_encoding, |
+ push_promise.stream_id(), |
+ PUSH_PROMISE); |
if (debug_visitor_) { |
- const size_t payload_len = protocol_version() > SPDY3 ? |
- hpack_encoding.size() : |
- GetSerializedLength(protocol_version(), |
- &(push_promise.name_value_block())); |
debug_visitor_->OnSendCompressedFrame(push_promise.stream_id(), |
- PUSH_PROMISE, payload_len, builder.length()); |
+ PUSH_PROMISE, hpack_encoding.size(), builder.length()); |
} |
return builder.take(); |