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

Side by Side Diff: net/http/http_proxy_client_socket_pool.cc

Issue 346713003: Surface ERR_SPDY_SESSION_ALREADY_EXISTS to the proxy delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_proxy_client_socket_pool.h" 5 #include "net/http/http_proxy_client_socket_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 if (IsCertificateError(result)) { 230 if (IsCertificateError(result)) {
231 if (params_->ssl_params()->load_flags() & LOAD_IGNORE_ALL_CERT_ERRORS) { 231 if (params_->ssl_params()->load_flags() & LOAD_IGNORE_ALL_CERT_ERRORS) {
232 result = OK; 232 result = OK;
233 } else { 233 } else {
234 // TODO(rch): allow the user to deal with proxy cert errors in the 234 // TODO(rch): allow the user to deal with proxy cert errors in the
235 // same way as server cert errors. 235 // same way as server cert errors.
236 transport_socket_handle_->socket()->Disconnect(); 236 transport_socket_handle_->socket()->Disconnect();
237 return ERR_PROXY_CERTIFICATE_INVALID; 237 return ERR_PROXY_CERTIFICATE_INVALID;
238 } 238 }
239 } 239 }
240 // A SPDY session to the proxy completed prior to resolving the proxy
241 // hostname. Surface this error, and allow the delegate to retry.
242 // See crbug.com/334413.
243 if (result == ERR_SPDY_SESSION_ALREADY_EXISTS) {
244 DCHECK(!transport_socket_handle_->socket());
245 return ERR_SPDY_SESSION_ALREADY_EXISTS;
246 }
240 if (result < 0) { 247 if (result < 0) {
241 if (transport_socket_handle_->socket()) 248 if (transport_socket_handle_->socket())
242 transport_socket_handle_->socket()->Disconnect(); 249 transport_socket_handle_->socket()->Disconnect();
243 return ERR_PROXY_CONNECTION_FAILED; 250 return ERR_PROXY_CONNECTION_FAILED;
Johnny 2014/06/19 04:08:43 Is there a particular rationale for converting to
Ryan Hamilton 2014/06/19 04:25:38 Wow, This code is a blast from the past. I *think*
244 } 251 }
245 252
246 SSLClientSocket* ssl = 253 SSLClientSocket* ssl =
247 static_cast<SSLClientSocket*>(transport_socket_handle_->socket()); 254 static_cast<SSLClientSocket*>(transport_socket_handle_->socket());
248 using_spdy_ = ssl->was_spdy_negotiated(); 255 using_spdy_ = ssl->was_spdy_negotiated();
249 protocol_negotiated_ = ssl->GetNegotiatedProtocol(); 256 protocol_negotiated_ = ssl->GetNegotiatedProtocol();
250 257
251 // Reset the timer to just the length of time allowed for HttpProxy handshake 258 // Reset the timer to just the length of time allowed for HttpProxy handshake
252 // so that a fast SSL connection plus a slow HttpProxy failure doesn't take 259 // so that a fast SSL connection plus a slow HttpProxy failure doesn't take
253 // longer to timeout than it should. 260 // longer to timeout than it should.
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 base_.RemoveHigherLayeredPool(higher_pool); 541 base_.RemoveHigherLayeredPool(higher_pool);
535 } 542 }
536 543
537 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { 544 bool HttpProxyClientSocketPool::CloseOneIdleConnection() {
538 if (base_.CloseOneIdleSocket()) 545 if (base_.CloseOneIdleSocket())
539 return true; 546 return true;
540 return base_.CloseOneIdleConnectionInHigherLayeredPool(); 547 return base_.CloseOneIdleConnectionInHigherLayeredPool();
541 } 548 }
542 549
543 } // namespace net 550 } // namespace net
OLDNEW
« 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