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

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

Issue 15293002: Fix socket leak in HttpServer, when the connection is closed while receiving data. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 months 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 | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_close_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_parser.dart
diff --git a/sdk/lib/io/http_parser.dart b/sdk/lib/io/http_parser.dart
index af937e9c93d5b07f9a2597325333ffff9ae794a6..ff0fcddd8f7710acb2c93a043f44c549367a73f2 100644
--- a/sdk/lib/io/http_parser.dart
+++ b/sdk/lib/io/http_parser.dart
@@ -729,7 +729,7 @@ class _HttpParser
new HttpParserException(
"Connection closed while receiving data"));
}
- _closeIncoming();
+ _closeIncoming(true);
_controller.close();
return;
}
@@ -909,7 +909,7 @@ class _HttpParser
if (_socketSubscription != null) {
_socketSubscription.cancel();
}
- _closeIncoming();
+ _closeIncoming(true);
_controller.close();
});
incoming = _incoming = new _HttpIncoming(
@@ -918,11 +918,11 @@ class _HttpParser
_pauseStateChanged();
}
- void _closeIncoming() {
+ void _closeIncoming([bool closing = false]) {
// Ignore multiple close (can happend in re-entrance).
if (_incoming == null) return;
var tmp = _incoming;
- tmp.close();
+ tmp.close(closing);
_incoming = null;
if (_bodyController != null) {
_bodyController.close();
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_close_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698