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

Unified Diff: runtime/bin/socket_patch.dart

Issue 21802002: Fix a Socket edge-case where the socket is closed by peer right after accept, where we havn't set a… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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/socket_patch.dart
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 0bcf75fd0a2899163b5f00e3fb5bf40447e70c3a..4d9225daa8170ddce139fd878df64d4757de8992 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -490,7 +490,9 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
if (i == ERROR_EVENT) {
reportError(nativeGetError(), "");
} else if (!isClosed) {
- handler();
+ // If the connection is closed right after it's accepted, there's a
+ // chance the close-handler is not set.
+ if (handler != null) handler();
}
}
}
« 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