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

Unified Diff: lib/src/io_io.dart

Issue 2666013004: Address a number of open issues. (Closed)
Patch Set: Close the parenthesis. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.md ('k') | lib/src/resolve.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/io_io.dart
diff --git a/lib/src/io_io.dart b/lib/src/io_io.dart
index 1056d755649dc00ae6797ac11470daf8a1fc30dd..619dfed0afea70ce20b1e210979feb7bb74d95f6 100644
--- a/lib/src/io_io.dart
+++ b/lib/src/io_io.dart
@@ -9,6 +9,7 @@ import "dart:io" show File,
HttpClient,
HttpClientResponse,
HttpClientRequest,
+ HttpException,
HttpHeaders;
import "package:typed_data/typed_buffers.dart" show Uint8Buffer;
@@ -90,9 +91,11 @@ Future<String> readAsString(Uri uri, Encoding encoding) async {
throw new UnsupportedError("Unsupported scheme: $uri");
}
+HttpClient _sharedHttpClient = new HttpClient()..maxConnectionsPerHost = 6;
+
Future<HttpClientResponse> _httpGetBytes(Uri uri) async {
- HttpClientRequest request = await new HttpClient().getUrl(uri);
- request.headers.set(HttpHeaders.ACCEPT, "application/octet-stream, */*");
+ HttpClientRequest request = await _sharedHttpClient.getUrl(uri);
+ request.headers.set(HttpHeaders.ACCEPT, "application/octet-stream, */*");
return request.close();
}
« no previous file with comments | « README.md ('k') | lib/src/resolve.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698