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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 1121043002: Make alternate Jobs not use HTTP/1.1 sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re: #13. Created 5 years, 7 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_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl_job.cc
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc
index 8910c8f96b52d13fb3db68bd8a7611a991c21670..b0176166af73ee42a417bc59ca85387cdf3ae9d4 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -1010,6 +1010,12 @@ int HttpStreamFactoryImpl::Job::DoInitConnectionComplete(int result) {
return result;
}
+ if (IsSpdyAlternate() && !using_spdy_) {
+ job_status_ = STATUS_BROKEN;
+ MaybeMarkAlternativeServiceBroken();
+ return ERR_NPN_NEGOTIATION_FAILED;
+ }
+
if (!ssl_started && result < 0 && IsAlternate()) {
job_status_ = STATUS_BROKEN;
// TODO(bnc): if (result == ERR_ALTERNATIVE_CERT_NOT_VALID_FOR_ORIGIN), then
@@ -1097,6 +1103,8 @@ int HttpStreamFactoryImpl::Job::DoCreateStream() {
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"462811 HttpStreamFactoryImpl::Job::DoCreateStream"));
DCHECK(connection_->socket() || existing_spdy_session_.get() || using_quic_);
+ if (IsAlternate())
+ DCHECK(IsSpdyAlternate());
next_state_ = STATE_CREATE_STREAM_COMPLETE;
@@ -1107,6 +1115,7 @@ int HttpStreamFactoryImpl::Job::DoCreateStream() {
SetSocketMotivation();
if (!using_spdy_) {
+ DCHECK(!IsSpdyAlternate());
// We may get ftp scheme when fetching ftp resources through proxy.
bool using_proxy = (proxy_info_.is_http() || proxy_info_.is_https()) &&
(request_info_.url.SchemeIs("http") ||
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698