| Index: runtime/bin/http_impl.dart
|
| diff --git a/runtime/bin/http_impl.dart b/runtime/bin/http_impl.dart
|
| index 0f5a63f6fc09223dd1acf1d37b827d7b30e72971..52d27193375a0be27e2e83d905c1d1d21f09ad6e 100644
|
| --- a/runtime/bin/http_impl.dart
|
| +++ b/runtime/bin/http_impl.dart
|
| @@ -1350,11 +1350,13 @@ class _HttpConnection extends _HttpConnectionBase {
|
|
|
| // If currently not processing any request just close the socket.
|
| if (_httpParser.isIdle) {
|
| - _destroy();
|
| - if (onClosed != null && e == null) {
|
| - // Don't call onClosed if onError has been called.
|
| - onClosed();
|
| - }
|
| + _socket.outputStream.onClosed = () {
|
| + _destroy();
|
| + if (onClosed != null && e == null) {
|
| + // Don't call onClosed if onError has been called.
|
| + onClosed();
|
| + }
|
| + };
|
| return;
|
| }
|
|
|
| @@ -1403,7 +1405,9 @@ class _HttpConnection extends _HttpConnectionBase {
|
| // If the connection is closing then close the output stream to
|
| // fully close the socket.
|
| if (_closing) {
|
| - _socket.close();
|
| + _socket.outputStream.onClosed = () {
|
| + _socket.close();
|
| + };
|
| }
|
| _response = null;
|
| }
|
|
|