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

Unified Diff: utils/pub/http.dart

Issue 12090104: Stop using cURL in Pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « utils/pub/hosted_source.dart ('k') | utils/pub/oauth2.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/http.dart
diff --git a/utils/pub/http.dart b/utils/pub/http.dart
index e148418e686501496dd26f2617b344ce090370cc..f8cb6994b70f66e033867ccfe3cb8165af06172e 100644
--- a/utils/pub/http.dart
+++ b/utils/pub/http.dart
@@ -11,7 +11,6 @@ import 'dart:json' as json;
// TODO(nweiz): Make this import better.
import '../../pkg/http/lib/http.dart' as http;
-import 'curl_client.dart';
import 'io.dart';
import 'log.dart' as log;
import 'utils.dart';
@@ -57,12 +56,16 @@ class PubHttpClient extends http.BaseClient {
});
}).catchError((asyncError) {
if (asyncError.error is SocketIOException &&
- asyncError.error.osError != null &&
- (asyncError.error.osError.errorCode == 8 ||
- asyncError.error.osError.errorCode == -2 ||
- asyncError.error.osError.errorCode == -5 ||
- asyncError.error.osError.errorCode == 11004)) {
- throw 'Could not resolve URL "${request.url.origin}".';
+ asyncError.error.osError != null) {
+ if (asyncError.error.osError.errorCode == 8 ||
+ asyncError.error.osError.errorCode == -2 ||
+ asyncError.error.osError.errorCode == -5 ||
+ asyncError.error.osError.errorCode == 11004) {
+ throw 'Could not resolve URL "${request.url.origin}".';
+ } else if (asyncError.error.osError.errorCode == -12276) {
+ throw 'Unable to validate SSL certificate for '
+ '"${request.url.origin}".';
+ }
}
throw asyncError;
}), HTTP_TIMEOUT, 'fetching URL "${request.url}"');
@@ -72,8 +75,6 @@ class PubHttpClient extends http.BaseClient {
/// The HTTP client to use for all HTTP requests.
final httpClient = new PubHttpClient();
-final curlClient = new PubHttpClient(new CurlClient());
-
/// Handles a successful JSON-formatted response from pub.dartlang.org.
///
/// These responses are expected to be of the form `{"success": {"message":
« no previous file with comments | « utils/pub/hosted_source.dart ('k') | utils/pub/oauth2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698