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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 } | 461 } |
462 | 462 |
463 void addError(error, [StackTrace stackTrace]) { | 463 void addError(error, [StackTrace stackTrace]) { |
464 _dataSink.addError(error, stackTrace); | 464 _dataSink.addError(error, stackTrace); |
465 } | 465 } |
466 | 466 |
467 Future<T> addStream(Stream<List<int>> stream) { | 467 Future<T> addStream(Stream<List<int>> stream) { |
468 return _dataSink.addStream(stream); | 468 return _dataSink.addStream(stream); |
469 } | 469 } |
470 | 470 |
| 471 Future flush() { |
| 472 return _dataSink.flush(); |
| 473 } |
| 474 |
471 Future close() { | 475 Future close() { |
472 return _dataSink.close(); | 476 return _dataSink.close(); |
473 } | 477 } |
474 | 478 |
475 Future<T> get done => _dataSink.done; | 479 Future<T> get done => _dataSink.done; |
476 | 480 |
477 Future _writeHeaders({bool drainRequest: true}) { | 481 Future _writeHeaders({bool drainRequest: true}) { |
478 if (_headersWritten) return new Future.value(); | 482 if (_headersWritten) return new Future.value(); |
479 _headersWritten = true; | 483 _headersWritten = true; |
480 headers._synchronize(); // Be sure the 'chunked' option is updated. | 484 headers._synchronize(); // Be sure the 'chunked' option is updated. |
(...skipping 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2247 | 2251 |
2248 void addError(error, [StackTrace stackTrace]) => | 2252 void addError(error, [StackTrace stackTrace]) => |
2249 _socket.addError(error, stackTrace); | 2253 _socket.addError(error, stackTrace); |
2250 | 2254 |
2251 Future<Socket> addStream(Stream<List<int>> stream) { | 2255 Future<Socket> addStream(Stream<List<int>> stream) { |
2252 return _socket.addStream(stream); | 2256 return _socket.addStream(stream); |
2253 } | 2257 } |
2254 | 2258 |
2255 void destroy() => _socket.destroy(); | 2259 void destroy() => _socket.destroy(); |
2256 | 2260 |
| 2261 Future flush() => _socket.flush(); |
| 2262 |
2257 Future close() => _socket.close(); | 2263 Future close() => _socket.close(); |
2258 | 2264 |
2259 Future<Socket> get done => _socket.done; | 2265 Future<Socket> get done => _socket.done; |
2260 | 2266 |
2261 int get port => _socket.port; | 2267 int get port => _socket.port; |
2262 | 2268 |
2263 InternetAddress get address => _socket.address; | 2269 InternetAddress get address => _socket.address; |
2264 | 2270 |
2265 String get remoteHost => _socket.remoteHost; | 2271 String get remoteHost => _socket.remoteHost; |
2266 | 2272 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2513 final Uri location; | 2519 final Uri location; |
2514 } | 2520 } |
2515 | 2521 |
2516 String _getHttpVersion() { | 2522 String _getHttpVersion() { |
2517 var version = Platform.version; | 2523 var version = Platform.version; |
2518 // Only include major and minor version numbers. | 2524 // Only include major and minor version numbers. |
2519 int index = version.indexOf('.', version.indexOf('.') + 1); | 2525 int index = version.indexOf('.', version.indexOf('.') + 1); |
2520 version = version.substring(0, index); | 2526 version = version.substring(0, index); |
2521 return 'Dart/$version (dart:io)'; | 2527 return 'Dart/$version (dart:io)'; |
2522 } | 2528 } |
OLD | NEW |