Skip to content
Snippets Groups Projects
Commit 6d56bbf3 authored by nweiz@google.com's avatar nweiz@google.com
Browse files

pipeInputToInput should be resilient to stream closure.

Review URL: https://codereview.chromium.org//11474048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@15880 260f80e4-7a28-3924-810f-c04153c831b5
parent 99827085
No related branches found
No related tags found
No related merge requests found
......@@ -619,7 +619,12 @@ Future pipeInputToInput(InputStream source, ListInputStream sink) {
sink.markEndOfStream();
completer.complete(null);
};
source.onData = () => sink.write(source.read());
source.onData = () {
// Even if the sink is closed and we aren't going to do anything with more
// data, we still need to drain it from source to work around issue 7218.
var data = source.read();
if (!sink.closed) sink.write(data);
};
// TODO(nweiz): propagate this error to the sink. See issue 3657.
source.onError = (e) { throw e; };
return completer.future;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment