| 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;
|
| }
|
|
|