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

Unified Diff: utils/pub/io.dart

Issue 11474048: pipeInputToInput should be resilient to stream closure. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/io.dart
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index 0c30c885dbb85046ad2d7999ee172b869224e213..dc779f5595d632b726d341670f78a81a4a9bd2eb 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -619,7 +619,9 @@ Future pipeInputToInput(InputStream source, ListInputStream sink) {
sink.markEndOfStream();
completer.complete(null);
};
- source.onData = () => sink.write(source.read());
+ source.onData = () {
+ if (!sink.closed) sink.write(source.read());
Bob Nystrom 2012/12/08 03:35:33 Should do the read() even if it's closed. Also, m
nweiz 2012/12/08 03:38:04 I think it's more or less "business as usual" for
+ };
// TODO(nweiz): propagate this error to the sink. See issue 3657.
source.onError = (e) { throw e; };
return completer.future;
« 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