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

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

Issue 1055943004: Process outstanding events before making a new HTTP client request (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments 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 | tests/standalone/io/https_bad_certificate_client.dart » ('j') | 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 // Make sure we go through the event loop before taking a
1887 // connection from the pool. For long-running synchronous code the
1888 // server might have closed the connection, so this lowers the
1889 // probability of getting a connection that was already closed.
1890 return new Future(() => connect(new HttpException("No proxies given")));
1887 } 1891 }
1888 1892
1889 _SiteCredentials _findCredentials(Uri url, [_AuthenticationScheme scheme]) { 1893 _SiteCredentials _findCredentials(Uri url, [_AuthenticationScheme scheme]) {
1890 // Look for credentials. 1894 // Look for credentials.
1891 _SiteCredentials cr = 1895 _SiteCredentials cr =
1892 _credentials.fold(null, (prev, value) { 1896 _credentials.fold(null, (prev, value) {
1893 if (value.applies(url, scheme)) { 1897 if (value.applies(url, scheme)) {
1894 if (prev == null) return value; 1898 if (prev == null) return value;
1895 return value.uri.path.length > prev.uri.path.length ? value : prev; 1899 return value.uri.path.length > prev.uri.path.length ? value : prev;
1896 } else { 1900 } else {
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
2812 const _RedirectInfo(this.statusCode, this.method, this.location); 2816 const _RedirectInfo(this.statusCode, this.method, this.location);
2813 } 2817 }
2814 2818
2815 String _getHttpVersion() { 2819 String _getHttpVersion() {
2816 var version = Platform.version; 2820 var version = Platform.version;
2817 // Only include major and minor version numbers. 2821 // Only include major and minor version numbers.
2818 int index = version.indexOf('.', version.indexOf('.') + 1); 2822 int index = version.indexOf('.', version.indexOf('.') + 1);
2819 version = version.substring(0, index); 2823 version = version.substring(0, index);
2820 return 'Dart/$version (dart:io)'; 2824 return 'Dart/$version (dart:io)';
2821 } 2825 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/https_bad_certificate_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698