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

Unified Diff: runtime/bin/http_impl.dart

Issue 10908121: Do not close sockets for http connection fully before we are (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698