| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // The close queue handles graceful closing of HTTP connections. When | 7 // The close queue handles graceful closing of HTTP connections. When |
| 8 // a connection is added to the queue it will enter a wait state | 8 // a connection is added to the queue it will enter a wait state |
| 9 // waiting for all data written and possibly socket shutdown from | 9 // waiting for all data written and possibly socket shutdown from |
| 10 // peer. | 10 // peer. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // Number of body bytes written. This is only actual body data not | 234 // Number of body bytes written. This is only actual body data not |
| 235 // including headers or chunk information of using chinked transfer | 235 // including headers or chunk information of using chinked transfer |
| 236 // encoding. | 236 // encoding. |
| 237 int _bodyBytesWritten = 0; | 237 int _bodyBytesWritten = 0; |
| 238 } | 238 } |
| 239 | 239 |
| 240 class _StreamingHttpRequestResponseBase extends _HttpRequestResponseBase { | 240 class _StreamingHttpRequestResponseBase extends _HttpRequestResponseBase { |
| 241 _StreamingHttpRequestResponseBase(_HttpConnectionBase connection) | 241 _StreamingHttpRequestResponseBase(_HttpConnectionBase connection) |
| 242 : super(connection); | 242 : super(connection); |
| 243 | 243 |
| 244 StreamSubscription<T> subscribe({void onData(T event), | 244 StreamSubscription<T> listen(void onData(T event), |
| 245 void onError(AsyncError error), | 245 { void onError(AsyncError error), |
| 246 void onDone(), | 246 void onDone(), |
| 247 bool unsubscribeOnError}) { | 247 bool unsubscribeOnError}) { |
| 248 return _controller.stream.subscribe(onData: onData, | 248 return _controller.stream.listen(onData, |
| 249 onError: onError, | 249 onError: onError, |
| 250 onDone: onDone, | 250 onDone: onDone, |
| 251 unsubscribeOnError: unsubscribeOnError); | 251 unsubscribeOnError: unsubscribeOnError); |
| 252 } | 252 } |
| 253 | 253 |
| 254 Stream transform({void onData(T data, StreamSink sink), | 254 Stream transform({void onData(T data, StreamSink sink), |
| 255 void onError(AsyncError errort, StreamSink sink), | 255 void onError(AsyncError errort, StreamSink sink), |
| 256 void onDone(StreamSink sink)}) { | 256 void onDone(StreamSink sink)}) { |
| 257 return _controller.stream.transform( | 257 return _controller.stream.transform( |
| 258 onData: onData, | 258 onData: onData, |
| 259 onError: onError, | 259 onError: onError, |
| 260 onDone: onDone); | 260 onDone: onDone); |
| 261 } | 261 } |
| (...skipping 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2383 | 2383 |
| 2384 | 2384 |
| 2385 class _RedirectInfo implements RedirectInfo { | 2385 class _RedirectInfo implements RedirectInfo { |
| 2386 const _RedirectInfo(int this.statusCode, | 2386 const _RedirectInfo(int this.statusCode, |
| 2387 String this.method, | 2387 String this.method, |
| 2388 Uri this.location); | 2388 Uri this.location); |
| 2389 final int statusCode; | 2389 final int statusCode; |
| 2390 final String method; | 2390 final String method; |
| 2391 final Uri location; | 2391 final Uri location; |
| 2392 } | 2392 } |
| OLD | NEW |