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

Unified Diff: sdk/lib/io/io_stream_consumer.dart

Issue 12328114: Rewrite the Future-pipeline from the Socket to the HttpClientRequest/HttpResponse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add missing test file. Created 7 years, 10 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 | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_close_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/io_stream_consumer.dart
diff --git a/sdk/lib/io/io_stream_consumer.dart b/sdk/lib/io/io_stream_consumer.dart
index 988eaf6e054c796b9c33b4cc239ab6f89ec0a245..b872fe4cf661eae9867cbf6bc10bc43448ea7e03 100644
--- a/sdk/lib/io/io_stream_consumer.dart
+++ b/sdk/lib/io/io_stream_consumer.dart
@@ -144,7 +144,10 @@ class IOSink<T> implements StreamConsumer<List<int>, T> {
onDone: () {
_bindSubscription = null;
if (unbind) {
- unbindCompleter.complete(null);
+ if (unbindCompleter != null) {
+ unbindCompleter.complete(null);
+ unbindCompleter = null;
+ }
} else {
_controller.close();
}
@@ -152,6 +155,11 @@ class IOSink<T> implements StreamConsumer<List<int>, T> {
onError: _controller.signalError);
if (_paused) _pause();
if (unbind) {
+ _pipeFuture.catchError((error) {
+ if (unbindCompleter != null) {
+ unbindCompleter.completeError(error);
+ }
+ });
return unbindCompleter.future;
} else {
return _pipeFuture;
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_close_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698