Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: sdk/lib/io/http_impl.dart

Issue 1070083002: Process outstanding events before making a new HTTP client request (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 _OUTGOING_BUFFER_SIZE = 8 * 1024; 7 const int _OUTGOING_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 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 Future<_ConnectionInfo> connect(error) { 1876 Future<_ConnectionInfo> connect(error) {
1877 if (!proxies.moveNext()) return new Future.error(error); 1877 if (!proxies.moveNext()) return new Future.error(error);
1878 _Proxy proxy = proxies.current; 1878 _Proxy proxy = proxies.current;
1879 String host = proxy.isDirect ? uriHost: proxy.host; 1879 String host = proxy.isDirect ? uriHost: proxy.host;
1880 int port = proxy.isDirect ? uriPort: proxy.port; 1880 int port = proxy.isDirect ? uriPort: proxy.port;
1881 return _getConnectionTarget(host, port, isSecure) 1881 return _getConnectionTarget(host, port, isSecure)
1882 .connect(uriHost, uriPort, proxy, this) 1882 .connect(uriHost, uriPort, proxy, this)
1883 // On error, continue with next proxy. 1883 // On error, continue with next proxy.
1884 .catchError(connect); 1884 .catchError(connect);
1885 } 1885 }
1886 return connect(new HttpException("No proxies given")); 1886 return new Future(() => connect(new HttpException("No proxies given")));
1887 } 1887 }
1888 1888
1889 _SiteCredentials _findCredentials(Uri url, [_AuthenticationScheme scheme]) { 1889 _SiteCredentials _findCredentials(Uri url, [_AuthenticationScheme scheme]) {
1890 // Look for credentials. 1890 // Look for credentials.
1891 _SiteCredentials cr = 1891 _SiteCredentials cr =
1892 _credentials.fold(null, (prev, value) { 1892 _credentials.fold(null, (prev, value) {
1893 if (value.applies(url, scheme)) { 1893 if (value.applies(url, scheme)) {
1894 if (prev == null) return value; 1894 if (prev == null) return value;
1895 return value.uri.path.length > prev.uri.path.length ? value : prev; 1895 return value.uri.path.length > prev.uri.path.length ? value : prev;
1896 } else { 1896 } else {
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
2812 const _RedirectInfo(this.statusCode, this.method, this.location); 2812 const _RedirectInfo(this.statusCode, this.method, this.location);
2813 } 2813 }
2814 2814
2815 String _getHttpVersion() { 2815 String _getHttpVersion() {
2816 var version = Platform.version; 2816 var version = Platform.version;
2817 // Only include major and minor version numbers. 2817 // Only include major and minor version numbers.
2818 int index = version.indexOf('.', version.indexOf('.') + 1); 2818 int index = version.indexOf('.', version.indexOf('.') + 1);
2819 version = version.substring(0, index); 2819 version = version.substring(0, index);
2820 return 'Dart/$version (dart:io)'; 2820 return 'Dart/$version (dart:io)';
2821 } 2821 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698