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

Unified Diff: runtime/bin/eventhandler_win.cc

Issue 426923003: Be sure we don't delete a ClientSocket, until 'connect' is completed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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: runtime/bin/eventhandler_win.cc
diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc
index cc42e62baf350b70a92d39ae045c7beac8f7a095..c58a758ad8444f1a6b6a07a73083f82b7beaba73 100644
--- a/runtime/bin/eventhandler_win.cc
+++ b/runtime/bin/eventhandler_win.cc
@@ -898,7 +898,6 @@ void ClientSocket::ConnectComplete(OverlappedBuffer* buffer) {
OverlappedBuffer::DisposeBuffer(buffer);
// Update socket to support full socket API, after ConnectEx completed.
setsockopt(socket(), SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0);
- connected_ = true;
Dart_Port p = port();
if (p != ILLEGAL_PORT) {
// If the port is set, we already listen for this socket in Dart.
@@ -925,7 +924,7 @@ void ClientSocket::EnsureInitialized(
bool ClientSocket::IsClosed() {
- return closed_;
+ return connected_ && closed_;
}
@@ -1197,6 +1196,8 @@ void EventHandlerImplementation::HandleConnect(
} else {
client_socket->ConnectComplete(buffer);
}
+ client_socket->mark_connected();
+ DeleteIfClosed(client_socket);
}
« 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