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

Unified Diff: runtime/bin/socket_patch.dart

Issue 173633002: Don't try to call read, if len i 0. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « runtime/bin/socket.cc ('k') | 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 76289c505c7cf4e47e6f93479a3ed85dffa20d4f..27329f139abece776673f92b4604f1e6b353c515 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -449,7 +449,9 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
throw new ArgumentError("Illegal length $len");
}
if (isClosing || isClosed) return null;
- var result = nativeRead(min(available, len == null ? available : len));
+ len = min(available, len == null ? available : len);
+ if (len == 0) return null;
+ var result = nativeRead(len);
if (result is OSError) {
reportError(result, "Read failed");
return null;
« no previous file with comments | « runtime/bin/socket.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698