| Index: sdk/lib/io/http_impl.dart
|
| diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
|
| index ef3aeb4e064c1e8759cb475b12e79c90a29ba7a1..e472a077f685f5bd19d8ab7e4a3b3003765d89e0 100644
|
| --- a/sdk/lib/io/http_impl.dart
|
| +++ b/sdk/lib/io/http_impl.dart
|
| @@ -32,7 +32,7 @@ class _CloseQueue {
|
| connection._state |= _HttpConnectionBase.CLOSING;
|
| _q.add(connection);
|
|
|
| - // If output stream is not closed for writing close it now and
|
| + // If the output stream is not closed for writing, close it now and
|
| // wait for callback when closed.
|
| if (!connection._isWriteClosed) {
|
| connection._socket.outputStream.close();
|
| @@ -44,14 +44,15 @@ class _CloseQueue {
|
| connection._socket.outputStream.onClosed = () { assert(false); };
|
| }
|
|
|
| - // If socket is not closed for reading wait for callback.
|
| + // If the request is not already fully read wait for the socket to close.
|
| + // As the _isReadClosed state from the HTTP request processing indicate
|
| + // that the response has been parsed this does not necesarily mean tha
|
| + // the socket is closed.
|
| if (!connection._isReadClosed) {
|
| connection._socket.onClosed = () {
|
| connection._state |= _HttpConnectionBase.READ_CLOSED;
|
| closeIfDone();
|
| };
|
| - } else {
|
| - connection._socket.onClosed = () { assert(false); };
|
| }
|
|
|
| // Ignore any data on a socket in the close queue.
|
| @@ -938,6 +939,7 @@ class _HttpConnection extends _HttpConnectionBase {
|
| _request = null;
|
| _response = null;
|
| if (close) {
|
| + _httpParser.cancel();
|
| _server._closeQueue.add(this);
|
| } else {
|
| _state = _HttpConnectionBase.IDLE;
|
| @@ -949,7 +951,7 @@ class _HttpConnection extends _HttpConnectionBase {
|
| // not care to read the request body) this is send.
|
| assert(!_isRequestDone);
|
| _writeBufferedResponse();
|
| - _close();
|
| + _httpParser.cancel();
|
| _server._closeQueue.add(this);
|
| }
|
| }
|
|
|