Chromium Code Reviews| 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 |