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

Side by Side Diff: net/socket/ssl_client_socket_mac.cc

Issue 206007: Uncouple the cert verifier when disconnecting to avoid a callback after a SSL... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « no previous file | 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) 2008-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008-2009 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/socket/ssl_client_socket_mac.h" 5 #include "net/socket/ssl_client_socket_mac.h"
6 6
7 #include "base/scoped_cftyperef.h" 7 #include "base/scoped_cftyperef.h"
8 #include "base/singleton.h" 8 #include "base/singleton.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "net/base/cert_verifier.h" 10 #include "net/base/cert_verifier.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 424
425 void SSLClientSocketMac::Disconnect() { 425 void SSLClientSocketMac::Disconnect() {
426 completed_handshake_ = false; 426 completed_handshake_ = false;
427 427
428 if (ssl_context_) { 428 if (ssl_context_) {
429 SSLClose(ssl_context_); 429 SSLClose(ssl_context_);
430 SSLDisposeContext(ssl_context_); 430 SSLDisposeContext(ssl_context_);
431 ssl_context_ = NULL; 431 ssl_context_ = NULL;
432 } 432 }
433 433
434 // Shut down anything that may call us back.
435 verifier_.reset();
434 transport_->Disconnect(); 436 transport_->Disconnect();
435 } 437 }
436 438
437 bool SSLClientSocketMac::IsConnected() const { 439 bool SSLClientSocketMac::IsConnected() const {
438 // Ideally, we should also check if we have received the close_notify alert 440 // Ideally, we should also check if we have received the close_notify alert
439 // message from the server, and return false in that case. We're not doing 441 // message from the server, and return false in that case. We're not doing
440 // that, so this function may return a false positive. Since the upper 442 // that, so this function may return a false positive. Since the upper
441 // layer (HttpNetworkTransaction) needs to handle a persistent connection 443 // layer (HttpNetworkTransaction) needs to handle a persistent connection
442 // closed by the server when we send a request anyway, a false positive in 444 // closed by the server when we send a request anyway, a false positive in
443 // exchange for simpler code is a good trade-off. 445 // exchange for simpler code is a good trade-off.
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 936
935 if (rv < 0 && rv != ERR_IO_PENDING) { 937 if (rv < 0 && rv != ERR_IO_PENDING) {
936 return OSStatusFromNetError(rv); 938 return OSStatusFromNetError(rv);
937 } 939 }
938 940
939 // always lie to our caller 941 // always lie to our caller
940 return noErr; 942 return noErr;
941 } 943 }
942 944
943 } // namespace net 945 } // namespace net
OLDNEW
« 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