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

Unified Diff: net/base/ssl_client_socket_win.cc

Issue 21501: If an idle socket has received data unexpectedly, we... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Final upload before checkin. Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/ssl_client_socket_win.h ('k') | net/base/tcp_client_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/ssl_client_socket_win.cc
===================================================================
--- net/base/ssl_client_socket_win.cc (revision 10055)
+++ net/base/ssl_client_socket_win.cc (working copy)
@@ -314,6 +314,17 @@
return completed_handshake_ && transport_->IsConnected();
}
+bool SSLClientSocketWin::IsConnectedAndIdle() const {
+ // Unlike IsConnected, this method doesn't return a false positive.
+ //
+ // Strictly speaking, we should check if we have received the close_notify
+ // alert message from the server, and return false in that case. Although
+ // the close_notify alert message means EOF in the SSL layer, it is just
+ // bytes to the transport layer below, so transport_->IsConnectedAndIdle()
+ // returns the desired false when we receive close_notify.
+ return completed_handshake_ && transport_->IsConnectedAndIdle();
+}
+
int SSLClientSocketWin::Read(char* buf, int buf_len,
CompletionCallback* callback) {
DCHECK(completed_handshake_);
« no previous file with comments | « net/base/ssl_client_socket_win.h ('k') | net/base/tcp_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698