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

Unified Diff: runtime/bin/socket_patch.dart

Issue 638303002: Don't create unused OSError in Socket_Available. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « 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 d598e273825b799e08ea8fed332508482b1d43c3..cd1cba9844af9e180ebb281968588ea1f076f381 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -572,7 +572,10 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
// the sum of all datagrams pending, so we need to call after each
// receive. If available becomes > 0, the _NativeSocket will continue to
// emit read events.
- available = nativeAvailable();
+ var avail = nativeAvailable();
+ if (avail != null) {
+ available = avail;
+ }
Ivan Posva 2014/10/09 06:12:07 available = (avail != null) avail : 1; With the s
Anders Johnsen 2014/10/09 06:17:07 Done.
totalRead += result.data.length;
}
readCount++;
@@ -745,7 +748,7 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
available++;
} else {
var avail = nativeAvailable();
- if (avail is int) {
+ if (avail != null) {
available = avail;
} else {
// Available failed. Mark socket as having data, to ensure read
« 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