| Index: net/spdy/spdy_framer.cc
|
| diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
|
| index 0901fe4c38b21b42b1f795ed5607e29f7a1593f6..ca8b7e082ac807bdda19e8ba1f74d9780160bfad 100644
|
| --- a/net/spdy/spdy_framer.cc
|
| +++ b/net/spdy/spdy_framer.cc
|
| @@ -119,6 +119,7 @@ const size_t SpdyFramer::kHeaderDataChunkMaxSize = 1024;
|
| // limit on control frame size for legacy reasons and to
|
| // mitigate DOS attacks.
|
| const size_t SpdyFramer::kMaxControlFrameSize = (1 << 14) - 1;
|
| +const size_t SpdyFramer::kMaxDataPayloadSendSize = 1 << 14;
|
| // The size of the control frame buffer. Must be >= the minimum size of the
|
| // largest control frame, which is SYN_STREAM. See GetSynStreamMinimumSize() for
|
| // calculation details.
|
| @@ -421,11 +422,21 @@ size_t SpdyFramer::GetFrameMinimumSize() const {
|
| }
|
|
|
| size_t SpdyFramer::GetFrameMaximumSize() const {
|
| - return SpdyConstants::GetFrameMaximumSize(protocol_version_);
|
| + if (protocol_version_ == HTTP2) {
|
| + return send_frame_size_limit_ +
|
| + SpdyConstants::GetFrameHeaderSize(protocol_version_);
|
| + } else {
|
| + return SpdyConstants::GetMaxFrameSizeLimit(protocol_version_);
|
| + }
|
| }
|
|
|
| size_t SpdyFramer::GetDataFrameMaximumPayload() const {
|
| - return GetFrameMaximumSize() - GetDataFrameMinimumSize();
|
| + if (protocol_version_ == HTTP2) {
|
| + return std::min(kMaxDataPayloadSendSize,
|
| + GetFrameMaximumSize() - GetDataFrameMinimumSize());
|
| + } else {
|
| + return GetFrameMaximumSize() - GetDataFrameMinimumSize();
|
| + }
|
| }
|
|
|
| size_t SpdyFramer::GetPrefixLength(SpdyFrameType type) const {
|
|
|