Chromium Code Reviews| Index: utils/pub/curl_client.dart |
| diff --git a/utils/pub/curl_client.dart b/utils/pub/curl_client.dart |
| index e1afc2dbb6c7fc4f77507194669765d4ad97b308..67fc35ca679bc09d37c37eeb0b87ab928d217dcc 100644 |
| --- a/utils/pub/curl_client.dart |
| +++ b/utils/pub/curl_client.dart |
| @@ -8,6 +8,7 @@ import 'dart:io'; |
| import '../../pkg/http/lib/http.dart' as http; |
| import 'io.dart'; |
| +import 'log.dart' as log; |
| import 'utils.dart'; |
| /// A drop-in replacement for [http.Client] that uses the `curl` command-line |
| @@ -30,11 +31,14 @@ class CurlClient extends http.BaseClient { |
| /// Sends a request via `curl` and returns the response. |
| Future<http.StreamedResponse> send(http.BaseRequest request) { |
| + log.fine("Sending Curl request $request"); |
| + |
| var requestStream = request.finalize(); |
| return withTempDir((tempDir) { |
| var headerFile = new Path(tempDir).append("curl-headers").toNativePath(); |
| var arguments = _argumentsForRequest(request, headerFile); |
| var process; |
| + log.process(executable, arguments); |
|
nweiz
2012/12/05 23:56:54
Style nit: swap this with the line above it.
Bob Nystrom
2012/12/06 01:33:26
Done.
|
| return Process.start(executable, arguments).chain((process_) { |
| process = process_; |
| if (requestStream.closed) { |
| @@ -98,6 +102,8 @@ class CurlClient extends http.BaseClient { |
| }); |
| arguments.add(request.url.toString()); |
| + log.fine("Curl request arguments: $arguments"); |
|
nweiz
2012/12/05 23:56:54
This seems redundant with log.process above.
Bob Nystrom
2012/12/06 01:33:26
Removed. I think for some reason when I skimmed th
|
| + |
| return arguments; |
| } |
| @@ -114,6 +120,8 @@ class CurlClient extends http.BaseClient { |
| Future _waitForHeaders(Process process, {bool expectBody}) { |
| var completer = new Completer(); |
| process.onExit = (exitCode) { |
| + log.io("Curl process exited with code $exitCode."); |
| + |
| if (exitCode == 0) { |
| completer.complete(null); |
| return; |
| @@ -122,6 +130,7 @@ class CurlClient extends http.BaseClient { |
| chainToCompleter(consumeInputStream(process.stderr) |
| .transform((stderrBytes) { |
| var message = new String.fromCharCodes(stderrBytes); |
| + log.fine(message); |
|
nweiz
2012/12/05 23:56:54
Give some context for this message.
Bob Nystrom
2012/12/06 01:33:26
Done.
|
| if (exitCode == 47) { |
| throw new RedirectLimitExceededException([]); |
| } else { |