mirror of
https://github.com/dart-lang/sdk
synced 2024-09-20 08:49:52 +00:00
Fix pub to close connection to dartlang.org when it's done downloading
See bug http://dartbug.com/4857 fixes: http://dartbug.com/4856 Review URL: https://chromiumcodereview.appspot.com//10913034 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11714 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
4987ff9cd9
commit
963d06882b
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue