Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Unified Diff: net/http/http_stream_factory.cc

Issue 9516009: SPDY - disable spdy/2.1 (flow control) by default (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_stream_factory.h ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory.cc
===================================================================
--- net/http/http_stream_factory.cc (revision 124201)
+++ net/http/http_stream_factory.cc (working copy)
@@ -10,7 +10,6 @@
#include "googleurl/src/gurl.h"
#include "net/base/host_mapping_rules.h"
#include "net/base/host_port_pair.h"
-#include "net/http/http_server_properties.h"
namespace net {
@@ -22,6 +21,8 @@
// static
std::vector<std::string>* HttpStreamFactory::next_protos_ = NULL;
// static
+bool HttpStreamFactory::enabled_protocols_[NUM_ALTERNATE_PROTOCOLS];
+// static
bool HttpStreamFactory::spdy_enabled_ = true;
// static
bool HttpStreamFactory::use_alternate_protocols_ = false;
@@ -56,6 +57,8 @@
force_spdy_always_ = false;
forced_spdy_exclusions_ = NULL;
ignore_certificate_errors_ = false;
+ for (int i = 0; i < NUM_ALTERNATE_PROTOCOLS; ++i)
+ enabled_protocols_[i] = false;
}
void HttpStreamFactory::ProcessAlternateProtocol(
@@ -81,10 +84,11 @@
}
AlternateProtocol protocol = ALTERNATE_PROTOCOL_BROKEN;
- // We skip NPN_SPDY_1 here, because we've rolled the protocol version to 2.
- for (int i = NPN_SPDY_2; i < NUM_ALTERNATE_PROTOCOLS; ++i) {
- if (port_protocol_vector[1] == kAlternateProtocolStrings[i])
+ for (int i = 0; i < NUM_ALTERNATE_PROTOCOLS; ++i) {
+ if (enabled_protocols_[i] &&
+ port_protocol_vector[1] == kAlternateProtocolStrings[i]) {
protocol = static_cast<AlternateProtocol>(i);
+ }
}
if (protocol == ALTERNATE_PROTOCOL_BROKEN) {
@@ -145,6 +149,30 @@
}
// static
+void HttpStreamFactory::SetNextProtos(const std::vector<std::string>& value) {
+ if (!next_protos_)
+ next_protos_ = new std::vector<std::string>;
+
+ *next_protos_ = value;
+
+ for (uint32 i = 0; i < NUM_ALTERNATE_PROTOCOLS; ++i)
+ enabled_protocols_[i] = false;
+
+ // TODO(rtenneti): bug 116575 - consider using same strings/enums for SPDY
+ // versions in next_protos and kAlternateProtocolStrings.
+ for (uint32 i = 0; i < value.size(); ++i) {
+ if (value[i] == "spdy/1") {
+ enabled_protocols_[NPN_SPDY_1] = true;
+ } else if (value[i] == "spdy/2") {
+ enabled_protocols_[NPN_SPDY_2] = true;
+ } else if (value[i] == "spdy/2.1") {
+ enabled_protocols_[NPN_SPDY_21] = true;
+ }
+ }
+ enabled_protocols_[NPN_SPDY_1] = false;
+}
+
+// static
void HttpStreamFactory::SetHostMappingRules(const std::string& rules) {
HostMappingRules* host_mapping_rules = new HostMappingRules;
host_mapping_rules->SetRulesFromString(rules);
« no previous file with comments | « net/http/http_stream_factory.h ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698