Commit 179a6e73 authored by xunjieli's avatar xunjieli Committed by Commit bot

Increase read buffer size for SPDY upload

The internal read buffer for upload is 14520 for QUIC, 2852 for
SPDY, and 16384 for normal stream. SPDY is too small compared
to normal stream and QUIC. This CL increases the read buffer to
16384 so it is comparable to the other two implementations.
This will make it easier for net embedders to configure uploads to
work well across different transports.

This CL additionally updates flow control tests so they take
into account the new buffer size when zeroing out window size.

BUG=606784

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

Cr-Commit-Position: refs/heads/master@{#389856}
parent a043fe61
......@@ -29,6 +29,8 @@
namespace net {
const size_t SpdyHttpStream::kRequestBodyBufferSize = 1 << 14; // 16KB
SpdyHttpStream::SpdyHttpStream(const base::WeakPtr<SpdySession>& spdy_session,
bool direct)
: spdy_session_(spdy_session),
......@@ -232,9 +234,7 @@ int SpdyHttpStream::SendRequest(const HttpRequestHeaders& request_headers,
CHECK(!request_body_buf_.get());
if (HasUploadData()) {
// Use kMaxSpdyFrameChunkSize as the buffer size, since the request
// body data is written with this size at a time.
request_body_buf_ = new IOBufferWithSize(kMaxSpdyFrameChunkSize);
request_body_buf_ = new IOBufferWithSize(kRequestBodyBufferSize);
// The request body buffer is empty at first.
request_body_buf_size_ = 0;
}
......
......@@ -32,6 +32,7 @@ class UploadDataStream;
class NET_EXPORT_PRIVATE SpdyHttpStream : public SpdyStream::Delegate,
public HttpStream {
public:
static const size_t kRequestBodyBufferSize;
// |spdy_session| must not be NULL.
SpdyHttpStream(const base::WeakPtr<SpdySession>& spdy_session, bool direct);
~SpdyHttpStream() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment