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

Unified Diff: runtime/bin/socket_stream_impl.dart

Issue 10905214: Fix two issues in the websocket. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | runtime/bin/websocket_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_stream_impl.dart
diff --git a/runtime/bin/socket_stream_impl.dart b/runtime/bin/socket_stream_impl.dart
index 901efa770fa53ad660aa91f1fa3d1697f80e2a85..504313d12d39c84cd89b9385affecca06749a54d 100644
--- a/runtime/bin/socket_stream_impl.dart
+++ b/runtime/bin/socket_stream_impl.dart
@@ -179,7 +179,14 @@ class _SocketOutputStream
List<int> buffer = _pendingWrites.first;
int offset = _pendingWrites.index;
int bytesToWrite = buffer.length - offset;
- int bytesWritten = _socket.writeList(buffer, offset, bytesToWrite);
+ int bytesWritten;
+ try {
+ bytesWritten = _socket.writeList(buffer, offset, bytesToWrite);
+ } catch (e) {
+ _pendingWrites.clear();
+ _onSocketError(e);
+ return;
+ }
_pendingWrites.removeBytes(bytesWritten);
if (bytesWritten < bytesToWrite) {
_socket._onWrite = _onWrite;
« no previous file with comments | « no previous file | runtime/bin/websocket_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698