TcpClientSocketWin::IsConnected could detect EOF
before the last received packet is returned via
completion callback.

BUG=98664
TEST=LayoutTests/http/tests/websocket/tests/hybi/close.html


Review URL: http://codereview.chromium.org/8083031

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104852 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/socket/tcp_client_socket_win.cc b/net/socket/tcp_client_socket_win.cc
index 1e69dd9..9b63765 100644
--- a/net/socket/tcp_client_socket_win.cc
+++ b/net/socket/tcp_client_socket_win.cc
@@ -589,6 +589,9 @@
   if (socket_ == INVALID_SOCKET || waiting_connect())
     return false;
 
+  if (waiting_read_)
+    return true;
+
   // Check if connection is alive.
   char c;
   int rv = recv(socket_, &c, 1, MSG_PEEK);
@@ -606,6 +609,9 @@
   if (socket_ == INVALID_SOCKET || waiting_connect())
     return false;
 
+  if (waiting_read_)
+    return true;
+
   // Check if connection is alive and we haven't received any data
   // unexpectedly.
   char c;