OLD | NEW |
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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 StreamController _controller; | 541 StreamController _controller; |
542 StreamSubscription _subscription; | 542 StreamSubscription _subscription; |
543 Completer _closeCompleter = new Completer(); | 543 Completer _closeCompleter = new Completer(); |
544 Completer _completer; | 544 Completer _completer; |
545 bool _socketError = false; | 545 bool _socketError = false; |
546 | 546 |
547 _HttpOutboundConsumer(_HttpOutboundMessage this._outbound); | 547 _HttpOutboundConsumer(_HttpOutboundMessage this._outbound); |
548 | 548 |
549 void _cancel() { | 549 void _cancel() { |
550 if (_subscription != null) { | 550 if (_subscription != null) { |
551 _subscription.cancel(); | 551 StreamSubscription subscription = _subscription; |
| 552 _subscription = null; |
| 553 subscription.cancel(); |
552 } | 554 } |
553 } | 555 } |
554 | 556 |
555 _ensureController() { | 557 _ensureController() { |
556 if (_controller != null) return; | 558 if (_controller != null) return; |
557 _controller = new StreamController(onPause: () => _subscription.pause(), | 559 _controller = new StreamController(onPause: () => _subscription.pause(), |
558 onResume: () => _subscription.resume(), | 560 onResume: () => _subscription.resume(), |
559 onCancel: _cancel); | 561 onCancel: _cancel); |
560 _outbound._addStream(_controller.stream) | 562 _outbound._addStream(_controller.stream) |
561 .then((_) { | 563 .then((_) { |
(...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2319 | 2321 |
2320 | 2322 |
2321 class _RedirectInfo implements RedirectInfo { | 2323 class _RedirectInfo implements RedirectInfo { |
2322 const _RedirectInfo(int this.statusCode, | 2324 const _RedirectInfo(int this.statusCode, |
2323 String this.method, | 2325 String this.method, |
2324 Uri this.location); | 2326 Uri this.location); |
2325 final int statusCode; | 2327 final int statusCode; |
2326 final String method; | 2328 final String method; |
2327 final Uri location; | 2329 final Uri location; |
2328 } | 2330 } |
OLD | NEW |