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

Side by Side Diff: sdk/lib/io/http_impl.dart

Issue 14729013: Make sure we always unsubscribe from a stream, in http-impl. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add back a test. Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/io/http_server_early_client_close2_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.io; 5 part of dart.io;
6 6
7 class _HttpIncoming extends Stream<List<int>> { 7 class _HttpIncoming extends Stream<List<int>> {
8 final int _transferLength; 8 final int _transferLength;
9 final Completer _dataCompleter = new Completer(); 9 final Completer _dataCompleter = new Completer();
10 Stream<List<int>> _stream; 10 Stream<List<int>> _stream;
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 } 560 }
561 561
562 _ensureController() { 562 _ensureController() {
563 if (_controller != null) return; 563 if (_controller != null) return;
564 _controller = new StreamController(onPause: _onPause, 564 _controller = new StreamController(onPause: _onPause,
565 onResume: _onPause, 565 onResume: _onPause,
566 onListen: _onListen, 566 onListen: _onListen,
567 onCancel: _onListen); 567 onCancel: _onListen);
568 _outbound._addStream(_controller.stream) 568 _outbound._addStream(_controller.stream)
569 .then((_) { 569 .then((_) {
570 _onListen(); // Make sure we unsubscribe.
570 _done(); 571 _done();
571 _closeCompleter.complete(_outbound); 572 _closeCompleter.complete(_outbound);
572 }, 573 },
573 onError: (error) { 574 onError: (error) {
574 if (!_done(error)) { 575 if (!_done(error)) {
575 _closeCompleter.completeError(error); 576 _closeCompleter.completeError(error);
576 } 577 }
577 }); 578 });
578 } 579 }
579 580
(...skipping 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after
2230 2231
2231 2232
2232 class _RedirectInfo implements RedirectInfo { 2233 class _RedirectInfo implements RedirectInfo {
2233 const _RedirectInfo(int this.statusCode, 2234 const _RedirectInfo(int this.statusCode,
2234 String this.method, 2235 String this.method,
2235 Uri this.location); 2236 Uri this.location);
2236 final int statusCode; 2237 final int statusCode;
2237 final String method; 2238 final String method;
2238 final Uri location; 2239 final Uri location;
2239 } 2240 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/http_server_early_client_close2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698