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 const int _HEADERS_BUFFER_SIZE = 8 * 1024; | 7 const int _HEADERS_BUFFER_SIZE = 8 * 1024; |
8 | 8 |
9 class _HttpIncoming extends Stream<List<int>> { | 9 class _HttpIncoming extends Stream<List<int>> { |
10 final int _transferLength; | 10 final int _transferLength; |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 _httpParser.responseToMethod = method; | 1336 _httpParser.responseToMethod = method; |
1337 _streamFuture = outgoing.done | 1337 _streamFuture = outgoing.done |
1338 .then((s) { | 1338 .then((s) { |
1339 // Request sent, set up response completer. | 1339 // Request sent, set up response completer. |
1340 _nextResponseCompleter = new Completer(); | 1340 _nextResponseCompleter = new Completer(); |
1341 | 1341 |
1342 // Listen for response. | 1342 // Listen for response. |
1343 _nextResponseCompleter.future | 1343 _nextResponseCompleter.future |
1344 .then((incoming) { | 1344 .then((incoming) { |
1345 _currentUri = null; | 1345 _currentUri = null; |
1346 incoming.dataDone.then((_) { | 1346 incoming.dataDone.then((closing) { |
1347 if (!_dispose && | 1347 if (!closing && |
| 1348 !_dispose && |
1348 incoming.headers.persistentConnection && | 1349 incoming.headers.persistentConnection && |
1349 request.persistentConnection) { | 1350 request.persistentConnection) { |
1350 // Return connection, now we are done. | 1351 // Return connection, now we are done. |
1351 _httpClient._returnConnection(this); | 1352 _httpClient._returnConnection(this); |
1352 _subscription.resume(); | 1353 _subscription.resume(); |
1353 } else { | 1354 } else { |
1354 destroy(); | 1355 destroy(); |
1355 } | 1356 } |
1356 }); | 1357 }); |
1357 // For digest authentication if proxy check if the proxy | 1358 // For digest authentication if proxy check if the proxy |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2568 const _RedirectInfo(this.statusCode, this.method, this.location); | 2569 const _RedirectInfo(this.statusCode, this.method, this.location); |
2569 } | 2570 } |
2570 | 2571 |
2571 String _getHttpVersion() { | 2572 String _getHttpVersion() { |
2572 var version = Platform.version; | 2573 var version = Platform.version; |
2573 // Only include major and minor version numbers. | 2574 // Only include major and minor version numbers. |
2574 int index = version.indexOf('.', version.indexOf('.') + 1); | 2575 int index = version.indexOf('.', version.indexOf('.') + 1); |
2575 version = version.substring(0, index); | 2576 version = version.substring(0, index); |
2576 return 'Dart/$version (dart:io)'; | 2577 return 'Dart/$version (dart:io)'; |
2577 } | 2578 } |
OLD | NEW |