summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 22:30:12 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 22:30:12 +0000
commit708cdbbd3d7cb047a57e71e4d33a9c1c3a80e3f8 (patch)
tree8e506b51ee0c71d081148b1ebfd8f70c38875480 /net
parent00c1a1272e75dba35f1d8d0b486f3852584ac8c1 (diff)
downloadchromium_src-708cdbbd3d7cb047a57e71e4d33a9c1c3a80e3f8.zip
chromium_src-708cdbbd3d7cb047a57e71e4d33a9c1c3a80e3f8.tar.gz
chromium_src-708cdbbd3d7cb047a57e71e4d33a9c1c3a80e3f8.tar.bz2
A follow-up of r28664.
Remove the unused member completed_handshake_. In OnHandshakeIOComplete, correct the comments to note that we also notify the caller of success. We cannot DCHECK renegotiating_ is true because DidCompleteRenegotiation has reset it to false. Instead, DCHECK the equivalent conditions in DidCompleteRenegotiation. Log the end of TYPE_SSL_CONNECT only for initial handshakes. In DoCompletedRenegotiation, result may not be OK. R=mbelshe BUG=none TEST=none Review URL: http://codereview.chromium.org/666004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/socket/ssl_client_socket_win.cc22
-rw-r--r--net/socket/ssl_client_socket_win.h2
2 files changed, 11 insertions, 13 deletions
diff --git a/net/socket/ssl_client_socket_win.cc b/net/socket/ssl_client_socket_win.cc
index ab3bca8..7e76f9e 100644
--- a/net/socket/ssl_client_socket_win.cc
+++ b/net/socket/ssl_client_socket_win.cc
@@ -645,18 +645,13 @@ bool SSLClientSocketWin::SetSendBufferSize(int32 size) {
void SSLClientSocketWin::OnHandshakeIOComplete(int result) {
int rv = DoLoop(result);
- // The SSL handshake has some round trips. Any error, other than waiting
- // for IO, means that we've failed and need to notify the caller.
+ // The SSL handshake has some round trips. We need to notify the caller of
+ // success or any error, other than waiting for IO.
if (rv != ERR_IO_PENDING) {
- LoadLog::EndEvent(load_log_, LoadLog::TYPE_SSL_CONNECT);
- load_log_ = NULL;
-
- // If there is no connect callback available to call, it had better be
- // because we are renegotiating (which occurs because we are in the middle
- // of a Read when the renegotiation process starts). We need to inform the
- // caller of the SSL error, so we complete the Read here.
+ // If there is no connect callback available to call, we are renegotiating
+ // (which occurs because we are in the middle of a Read when the
+ // renegotiation process starts). So we complete the Read here.
if (!user_connect_callback_) {
- DCHECK(renegotiating_);
CompletionCallback* c = user_read_callback_;
user_read_callback_ = NULL;
user_read_buf_ = NULL;
@@ -664,6 +659,8 @@ void SSLClientSocketWin::OnHandshakeIOComplete(int result) {
c->Run(rv);
return;
}
+ LoadLog::EndEvent(load_log_, LoadLog::TYPE_SSL_CONNECT);
+ load_log_ = NULL;
CompletionCallback* c = user_connect_callback_;
user_connect_callback_ = NULL;
c->Run(rv);
@@ -1285,7 +1282,8 @@ int SSLClientSocketWin::DoCompletedRenegotiation(int result) {
// The user had a read in progress, which was usurped by the renegotiation.
// Restart the read sequence.
next_state_ = STATE_COMPLETED_HANDSHAKE;
- DCHECK(result == OK);
+ if (result != OK)
+ return result;
return DoPayloadRead();
}
@@ -1322,6 +1320,8 @@ int SSLClientSocketWin::DidCompleteHandshake() {
// Called when a renegotiation is completed. |result| is the verification
// result of the server certificate received during renegotiation.
void SSLClientSocketWin::DidCompleteRenegotiation() {
+ DCHECK(!user_connect_callback_);
+ DCHECK(user_read_callback_);
renegotiating_ = false;
next_state_ = STATE_COMPLETED_RENEGOTIATION;
}
diff --git a/net/socket/ssl_client_socket_win.h b/net/socket/ssl_client_socket_win.h
index 84a42de..3a7d21c 100644
--- a/net/socket/ssl_client_socket_win.h
+++ b/net/socket/ssl_client_socket_win.h
@@ -164,8 +164,6 @@ class SSLClientSocketWin : public SSLClientSocket {
// state.
bool writing_first_token_;
- bool completed_handshake_;
-
// Only used in the STATE_HANDSHAKE_READ_COMPLETE and
// STATE_PAYLOAD_READ_COMPLETE states. True if a 'result' argument of OK
// should be ignored, to prevent it from being interpreted as EOF.