diff options
author | wtc@google.com <wtc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-05 23:34:51 +0000 |
---|---|---|
committer | wtc@google.com <wtc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-05 23:34:51 +0000 |
commit | 35f7999be5e8ef6f623147e8aff9e39430045167 (patch) | |
tree | 77117ff198b4a5b50328eca13f4b412ce8f8a540 | |
parent | 3a930b80debc7154567973e1d9e2692af7f5ffdb (diff) | |
download | chromium_src-35f7999be5e8ef6f623147e8aff9e39430045167.zip chromium_src-35f7999be5e8ef6f623147e8aff9e39430045167.tar.gz chromium_src-35f7999be5e8ef6f623147e8aff9e39430045167.tar.bz2 |
The previous fix doesn't work. We should continue
decrypting if there is still extra data to decrypt,
and read more if there is no data to decrypt.
R=darin
BUG=b/1329345,b/1329363
Review URL: http://codereview.chromium.org/480
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1814 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/base/ssl_client_socket.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/base/ssl_client_socket.cc b/net/base/ssl_client_socket.cc index bd1bef6..4a0747a 100644 --- a/net/base/ssl_client_socket.cc +++ b/net/base/ssl_client_socket.cc @@ -607,10 +607,16 @@ int SSLClientSocket::DoPayloadReadComplete(int result) { } // TODO(wtc): need to handle SEC_I_RENEGOTIATE. DCHECK(status == SEC_E_OK); - // If we didn't read enough to be able to decrypt anything, don't report 0 - // bytes read, which would be interpreted as EOF. Go back to read more. - if (len == 0) - next_state_ = STATE_PAYLOAD_READ; + // If we decrypted 0 bytes, don't report 0 bytes read, which would be + // mistaken for EOF. Continue decrypting or read more. + if (len == 0) { + if (bytes_received_ == 0) { + next_state_ = STATE_PAYLOAD_READ; + } else { + next_state_ = STATE_PAYLOAD_READ_COMPLETE; + ignore_ok_result_ = true; // OK doesn't mean EOF. + } + } return len; } |