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

Unified Diff: runtime/bin/socket_patch.dart

Issue 2632543002: Don't clobber SocketError's OSError on failed write and send. (Closed)
Patch Set: Really fix it Created 3 years, 11 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 cd02b29ab921253818f8f8f8201660b9a6896a7d..c11cec115ea13aa884322aaadfdb1fbf51bc6cbf 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -669,7 +669,8 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
var result =
nativeWrite(bufferAndStart.buffer, bufferAndStart.start, bytes);
if (result is OSError) {
- scheduleMicrotask(() => reportError(result, "Write failed"));
+ OSError osError = result;
+ scheduleMicrotask(() => reportError(osError, "Write failed"));
result = 0;
}
// The result may be negative, if we forced a short write for testing
@@ -699,7 +700,8 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
bufferAndStart.buffer, bufferAndStart.start, bytes,
address._in_addr, port);
if (result is OSError) {
- scheduleMicrotask(() => reportError(result, "Send failed"));
+ OSError osError = result;
+ scheduleMicrotask(() => reportError(osError, "Send failed"));
result = 0;
}
// TODO(ricow): Remove when we track internal and pipe uses.
« 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