Index: utils/pub/io.dart |
diff --git a/utils/pub/io.dart b/utils/pub/io.dart |
index e3fc8e0202c4b84edcfc59abe54584009037bf9d..0874ba876edffd49c9414d74417bec7b0577450b 100644 |
--- a/utils/pub/io.dart |
+++ b/utils/pub/io.dart |
@@ -291,7 +291,8 @@ String getFullPath(entry) => new File(_getPath(entry)).fullPathSync(); |
*/ |
InputStream httpGet(uri) { |
var resultStream = new ListInputStream(); |
- var connection = new HttpClient().getUrl(_getUri(uri)); |
+ var client = new HttpClient(); |
+ var connection = client.getUrl(_getUri(uri)); |
// TODO(nweiz): propagate this error to the return value. See issue 3657. |
connection.onError = (e) { throw e; }; |
@@ -302,7 +303,7 @@ InputStream httpGet(uri) { |
"HTTP request for $uri failed with status ${response.statusCode}"); |
} |
- pipeInputToInput(response.inputStream, resultStream); |
+ pipeInputToInput(response.inputStream, resultStream, client.shutdown); |
}; |
return resultStream; |