Index: utils/pub/io.dart |
diff --git a/utils/pub/io.dart b/utils/pub/io.dart |
index ce853b25e6093ada9d94daa1996f32631534a9fd..63879b3128a151d25f45a3a8d35b4794f243d878 100644 |
--- a/utils/pub/io.dart |
+++ b/utils/pub/io.dart |
@@ -741,31 +741,6 @@ Future _doProcess(Function fn, String executable, List<String> args, workingDir, |
return fn(executable, args, options); |
} |
-/// Closes [response] while ignoring the body of [request]. Returns a Future |
-/// that completes once the response is closed. |
-/// |
-/// Due to issue 6984, it's necessary to drain the request body before closing |
-/// the response. |
-Future closeHttpResponse(HttpRequest request, HttpResponse response) { |
- // TODO(nweiz): remove this when issue 4061 is fixed. |
- var stackTrace; |
- try { |
- throw ""; |
- } catch (_, localStackTrace) { |
- stackTrace = localStackTrace; |
- } |
- |
- var completer = new Completer(); |
- request.inputStream.onError = (e) => |
- completer.completeException(e, stackTrace); |
- request.inputStream.onData = request.inputStream.read; |
- request.inputStream.onClosed = () { |
- response.outputStream.close(); |
- completer.complete(null); |
- }; |
- return completer.future; |
-} |
- |
/** |
* Wraps [input] to provide a timeout. If [input] completes before |
* [milliseconds] have passed, then the return value completes in the same way. |