Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(706)

Unified Diff: sdk/lib/io/http_impl.dart

Issue 11606020: Reapply "Fixes to eventhandler and HTTP"" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove invalid assert (fixes Windows test) Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | sdk/lib/io/http_parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | sdk/lib/io/http_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698