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

Unified Diff: utils/pub/curl_client.dart

Issue 11830017: Fix ALL the pub tests. (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
Index: utils/pub/curl_client.dart
diff --git a/utils/pub/curl_client.dart b/utils/pub/curl_client.dart
index 7361b09abfc5b0d6bfbb6d6e5c33c1f7b0eebdd9..22e25dd788ed66ad20ab9876cee25d7e2fa414d2 100644
--- a/utils/pub/curl_client.dart
+++ b/utils/pub/curl_client.dart
@@ -42,12 +42,8 @@ class CurlClient extends http.BaseClient {
var process;
return startProcess(executable, arguments).then((process_) {
process = process_;
- if (requestStream.closed) {
- process.stdin.close();
- } else {
- requestStream.pipe(process.stdin);
- }
-
+ return requestStream.pipe(wrapOutputStream(process.stdin));
+ }).then((_) {
return _waitForHeaders(process, expectBody: request.method != "HEAD");
}).then((_) => new File(headerFile).readAsLines())
.then((lines) => _buildResponse(request, process, lines));
@@ -126,8 +122,7 @@ class CurlClient extends http.BaseClient {
return;
}
- chainToCompleter(consumeInputStream(process.stderr)
- .then((stderrBytes) {
+ chainToCompleter(consumeInputStream(process.stderr).then((stderrBytes) {
var message = new String.fromCharCodes(stderrBytes);
log.fine('Got error reading headers from curl: $message');
if (exitCode == 47) {
@@ -183,7 +178,8 @@ class CurlClient extends http.BaseClient {
contentLength = int.parse(headers['content-length']);
}
- return new http.StreamedResponse(responseStream, status, contentLength,
+ return new http.StreamedResponse(
+ wrapInputStream(responseStream), status, contentLength,
request: request,
headers: headers,
isRedirect: isRedirect,
« no previous file with comments | « utils/pub/command_uploader.dart ('k') | utils/pub/git.dart » ('j') | utils/pub/git.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698