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