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

Unified Diff: net/socket/tcp_client_socket_win.cc

Issue 8083031: TcpClientSocketWin may detect EOF before the last asynchronous I/O (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: checking just waiting_read_ is sufficient Created 9 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_client_socket_win.cc
diff --git a/net/socket/tcp_client_socket_win.cc b/net/socket/tcp_client_socket_win.cc
index 8b192f4c2c800e773de01dcd87b7d4dd26aea76a..46a02d2416075880d29f249474434bd9e824247d 100644
--- a/net/socket/tcp_client_socket_win.cc
+++ b/net/socket/tcp_client_socket_win.cc
@@ -589,6 +589,9 @@ bool TCPClientSocketWin::IsConnected() const {
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 @@ bool TCPClientSocketWin::IsConnectedAndIdle() const {
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698