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

Unified Diff: net/http/http_network_transaction.cc

Issue 519048: SSL: remove NOTREACHED from GetNextProto error path. (Closed)
Patch Set: ... Created 10 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 5dc01ca6bee1a07b8f4bc301928fa0f5062fe0a0..6006ccc65d492dcc3aa800671a5c74b565ff72ee 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -799,10 +799,17 @@ int HttpNetworkTransaction::DoSSLConnect() {
int HttpNetworkTransaction::DoSSLConnectComplete(int result) {
SSLClientSocket* ssl_socket =
reinterpret_cast<SSLClientSocket*>(connection_->socket());
+
+ SSLClientSocket::NextProtoStatus status =
+ SSLClientSocket::kNextProtoUnsupported;
std::string proto;
- SSLClientSocket::NextProtoStatus status = ssl_socket->GetNextProto(&proto);
+ // GetNextProto will fail and and trigger a NOTREACHED if we pass in a socket
+ // that hasn't had SSL_ImportFD called on it. If we get a certificate error
+ // here, then we know that we called SSL_ImportFD.
+ if (result == OK || IsCertificateError(result))
+ status = ssl_socket->GetNextProto(&proto);
static const char kSpdyProto[] = "spdy";
- const bool use_spdy = (status != SSLClientSocket::kNextProtoUnsupported &&
+ const bool use_spdy = (status == SSLClientSocket::kNextProtoNegotiated &&
proto == kSpdyProto);
if (IsCertificateError(result)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698