Chromium Code Reviews| Index: net/quic/quic_stream_factory.cc |
| diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc |
| index 310f93e964a96b967ac6f462a588bab4f13944bb..05ab72b0c84deac505ed4c75c750f76918923216 100644 |
| --- a/net/quic/quic_stream_factory.cc |
| +++ b/net/quic/quic_stream_factory.cc |
| @@ -56,6 +56,17 @@ enum CreateSessionFailure { |
| // The initial receive window size for both streams and sessions. |
| const int32 kInitialReceiveWindowSize = 10 * 1024 * 1024; // 10MB |
| +// The suggested initial congestion windows for a server to use. |
| +// TODO: This should be tested and optimized, and even better, suggest a window |
| +// that corresponds to historical bandwidth and min-RTT. |
| +// Larger initial congestion windows can, if we don't overshoot, reduce latency |
| +// by avoiding the RTT needed for slow start to double (and re-double) from a |
| +// default of 10. |
| +// We match SPDY's use of 32 when secure (since we'd compete with SPDY). |
| +const int32 kServerSecureInitialCongestionWindow = 32; |
| +// Be conservative, and just use double a typical TCP ICWND for HTTP. |
| +const int32 kServerInecureInitialCongestionWindow = 20; |
| + |
| void HistogramCreateSessionFailure(enum CreateSessionFailure error) { |
| UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.CreationError", error, |
| CREATION_ERROR_MAX); |
| @@ -743,6 +754,10 @@ int QuicStreamFactory::CreateSession( |
| InitializeCachedStateInCryptoConfig(server_id, server_info); |
| QuicConfig config = config_; |
| + config_.SetInitialCongestionWindowToSend( |
| + server_id.is_https() ? kServerSecureInitialCongestionWindow |
| + : kServerInecureInitialCongestionWindow); |
| + if (server_id.is_https()) |
|
Ryan Hamilton
2014/05/16 19:53:38
It this line a typo?
jar (doing other things)
2014/05/16 21:03:22
Yes... typo indeed. Removed. Thanks!
|
| if (http_server_properties_) { |
| const HttpServerProperties::NetworkStats* stats = |
| http_server_properties_->GetServerNetworkStats( |