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

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

Issue 3107036: Fix a crash where we are checking IsConnected(). If you look into the ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: nits, extra EXPECTS() in test cases added Created 10 years, 3 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_proxy_client_socket.cc ('k') | net/socket/socket_test_util.h » ('j') | 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) 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
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
OLDNEW
« no previous file with comments | « net/http/http_proxy_client_socket.cc ('k') | net/socket/socket_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698