Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_stream_parser.h" | 5 #include "net/http/http_stream_parser.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/histogram.h" | 8 #include "base/histogram.h" |
| 9 #include "net/base/auth.h" | 9 #include "net/base/auth.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 572 return connection_->is_reused() || | 572 return connection_->is_reused() || |
| 573 reuse_type == ClientSocketHandle::UNUSED_IDLE; | 573 reuse_type == ClientSocketHandle::UNUSED_IDLE; |
| 574 } | 574 } |
| 575 | 575 |
| 576 void HttpStreamParser::SetConnectionReused() { | 576 void HttpStreamParser::SetConnectionReused() { |
| 577 connection_->set_is_reused(true); | 577 connection_->set_is_reused(true); |
| 578 } | 578 } |
| 579 | 579 |
| 580 void HttpStreamParser::GetSSLInfo(SSLInfo* ssl_info) { | 580 void HttpStreamParser::GetSSLInfo(SSLInfo* ssl_info) { |
| 581 if (request_->url.SchemeIs("https")) { | 581 if (request_->url.SchemeIs("https")) { |
| 582 CHECK(connection_->socket()->IsConnected()); | 582 if (!connection_->socket() || !connection_->socket()->IsConnected()) |
|
eroman
2010/08/25 05:26:47
we weren't previously checking to see if socket is
Mike Belshe
2010/08/25 06:22:32
It's not really valid. I was just making it the s
| |
| 583 return; | |
| 583 SSLClientSocket* ssl_socket = | 584 SSLClientSocket* ssl_socket = |
| 584 static_cast<SSLClientSocket*>(connection_->socket()); | 585 static_cast<SSLClientSocket*>(connection_->socket()); |
| 585 ssl_socket->GetSSLInfo(ssl_info); | 586 ssl_socket->GetSSLInfo(ssl_info); |
| 586 } | 587 } |
| 587 } | 588 } |
| 588 | 589 |
| 589 void HttpStreamParser::GetSSLCertRequestInfo( | 590 void HttpStreamParser::GetSSLCertRequestInfo( |
| 590 SSLCertRequestInfo* cert_request_info) { | 591 SSLCertRequestInfo* cert_request_info) { |
| 591 if (request_->url.SchemeIs("https")) { | 592 if (request_->url.SchemeIs("https")) { |
| 592 if (!connection_->socket() || !connection_->socket()->IsConnected()) | 593 if (!connection_->socket() || !connection_->socket()->IsConnected()) |
| 593 return; | 594 return; |
| 594 CHECK(connection_->socket()->IsConnected()); | |
| 595 SSLClientSocket* ssl_socket = | 595 SSLClientSocket* ssl_socket = |
| 596 static_cast<SSLClientSocket*>(connection_->socket()); | 596 static_cast<SSLClientSocket*>(connection_->socket()); |
| 597 ssl_socket->GetSSLCertRequestInfo(cert_request_info); | 597 ssl_socket->GetSSLCertRequestInfo(cert_request_info); |
| 598 } | 598 } |
| 599 } | 599 } |
| 600 | 600 |
| 601 } // namespace net | 601 } // namespace net |
| OLD | NEW |