summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_session.h
diff options
context:
space:
mode:
authoragayev@chromium.org <agayev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-22 02:29:16 +0000
committeragayev@chromium.org <agayev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-22 02:29:16 +0000
commit7349c6b146c267b7f634d518296f631642ef7095 (patch)
treed74e8aeeef9e20e83a44c798ac68bb8b7f3e2a2b /net/spdy/spdy_session.h
parentebf40a790f097712268847862f8a94ce2f69c772 (diff)
downloadchromium_src-7349c6b146c267b7f634d518296f631642ef7095.zip
chromium_src-7349c6b146c267b7f634d518296f631642ef7095.tar.gz
chromium_src-7349c6b146c267b7f634d518296f631642ef7095.tar.bz2
SPDY flow control: enforce obeying send window size via a command-line switch, initial support for receive window size.
BUG=48100 TEST=net_unittestss --gtest_filter="SpdyProtocolTest.ControlFrameStructs:SpdyNetworkTransactionTest.WindowUpdate:SpdyNetworkTransactionTest.WindowUpdateOverflow" Review URL: http://codereview.chromium.org/3052005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53297 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session.h')
-rw-r--r--net/spdy/spdy_session.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index 3add9b0..16f4517 100644
--- a/net/spdy/spdy_session.h
+++ b/net/spdy/spdy_session.h
@@ -31,6 +31,13 @@
namespace net {
+// This is somewhat arbitrary and not really fixed, but it will always work
+// reasonably with ethernet. Chop the world into 2-packet chunks. This is
+// somewhat arbitrary, but is reasonably small and ensures that we elicit
+// ACKs quickly from TCP (because TCP tries to only ACK every other packet).
+const int kMss = 1430;
+const int kMaxSpdyFrameChunkSize = (2 * kMss) - spdy::SpdyFrame::size();
+
class SpdyStream;
class HttpNetworkSession;
class BoundNetLog;
@@ -118,6 +125,9 @@ class SpdySession : public base::RefCounted<SpdySession>,
static void SetSSLMode(bool enable) { use_ssl_ = enable; }
static bool SSLMode() { return use_ssl_; }
+ // Enable or disable flow control.
+ static void SetFlowControl(bool enable) { use_flow_control_ = enable; }
+
// If session is closed, no new streams/transactions should be created.
bool IsClosed() const { return state_ == CLOSED; }
@@ -327,14 +337,15 @@ class SpdySession : public base::RefCounted<SpdySession>,
bool in_session_pool_; // True if the session is currently in the pool.
- int initial_window_size_; // Initial window size for the session; can be
- // changed by an arriving SETTINGS frame; newly
- // created streams use this value for the initial
- // window size.
+ // Initial send window size for the session; can be changed by an
+ // arriving SETTINGS frame; newly created streams use this value for the
+ // initial send window size.
+ int initial_send_window_size_;
BoundNetLog net_log_;
static bool use_ssl_;
+ static bool use_flow_control_;
};
} // namespace net