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

Unified Diff: runtime/bin/socket.cc

Issue 11606020: Reapply "Fixes to eventhandler and HTTP"" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove invalid assert (fixes Windows test) Created 8 years 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/eventhandler_win.cc ('k') | runtime/bin/socket_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket.cc
diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc
index e0e82420b8f7461396e27d514adb8234aaf33888..2013e093efa492699775419ceeeebb0b26b7318d 100644
--- a/runtime/bin/socket.cc
+++ b/runtime/bin/socket.cc
@@ -187,7 +187,7 @@ void FUNCTION_NAME(Socket_WriteList)(Dart_NativeArguments args) {
Dart_PropagateError(result);
}
bytes_written = Socket::Write(socket, buffer, length);
- total_bytes_written = bytes_written;
+ if (bytes_written > 0) total_bytes_written = bytes_written;
} else {
// Send data in chunks of maximum 16KB.
const intptr_t max_chunk_length =
@@ -206,7 +206,7 @@ void FUNCTION_NAME(Socket_WriteList)(Dart_NativeArguments args) {
}
bytes_written =
Socket::Write(socket, reinterpret_cast<void*>(buffer), chunk_length);
- total_bytes_written += bytes_written;
+ if (bytes_written > 0) total_bytes_written += bytes_written;
} while (bytes_written > 0 && total_bytes_written < length);
delete[] buffer;
}
« no previous file with comments | « runtime/bin/eventhandler_win.cc ('k') | runtime/bin/socket_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698