diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 17:20:41 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 17:20:41 +0000 |
commit | 82875d6d6604fb5563a69456b810205b8e14bb64 (patch) | |
tree | 03d289e10aca5ebbdfd82d9411a52bbbb7bb9abb /net/base/ssl_client_socket_win.cc | |
parent | 43bc84ba50c30b4d2ee42108dbf116fbd5382ce1 (diff) | |
download | chromium_src-82875d6d6604fb5563a69456b810205b8e14bb64.zip chromium_src-82875d6d6604fb5563a69456b810205b8e14bb64.tar.gz chromium_src-82875d6d6604fb5563a69456b810205b8e14bb64.tar.bz2 |
Set completed_handshake_ to true after the entire Connect
sequence is done, otherwise IsConnected may return true
prematurely (while in the STATE_VERIFY_CERT state).
R=markus
Review URL: http://codereview.chromium.org/56098
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12869 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/ssl_client_socket_win.cc')
-rw-r--r-- | net/base/ssl_client_socket_win.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/base/ssl_client_socket_win.cc b/net/base/ssl_client_socket_win.cc index 832186f..96484fa 100644 --- a/net/base/ssl_client_socket_win.cc +++ b/net/base/ssl_client_socket_win.cc @@ -698,10 +698,16 @@ int SSLClientSocketWin::DoVerifyCert() { int SSLClientSocketWin::DoVerifyCertComplete(int result) { LogConnectionTypeMetrics(); if (renegotiating_) { + // A rehandshake, started in the middle of a Read, has completed. renegotiating_ = false; // Pick up where we left off. Go back to reading data. if (result == OK) SetNextStateForRead(); + } else { + // The initial handshake, kicked off by a Connect, has completed. + completed_handshake_ = true; + // Exit DoLoop and return the result to the caller of Connect. + DCHECK(next_state_ == STATE_NONE); } return result; } @@ -946,7 +952,6 @@ int SSLClientSocketWin::DidCompleteHandshake() { server_cert_ = X509Certificate::CreateFromHandle( server_cert_handle, X509Certificate::SOURCE_FROM_NETWORK); - completed_handshake_ = true; next_state_ = STATE_VERIFY_CERT; return OK; } |