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

Side by Side Diff: runtime/bin/http_impl.dart

Issue 10008075: Close socket, and not non-existing outputStream. Fixes crash in HttpServer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't include old commit. Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class _HttpRequestResponseBase { 5 class _HttpRequestResponseBase {
6 _HttpRequestResponseBase(_HttpConnectionBase this._httpConnection) 6 _HttpRequestResponseBase(_HttpConnectionBase this._httpConnection)
7 : _contentLength = -1, 7 : _contentLength = -1,
8 _keepAlive = false, 8 _keepAlive = false,
9 _headers = new Map(); 9 _headers = new Map();
10 10
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 if (_request != null) { 625 if (_request != null) {
626 _request._onDataEnd(); 626 _request._onDataEnd();
627 } 627 }
628 _request = null; 628 _request = null;
629 } 629 }
630 630
631 void _responseDone() { 631 void _responseDone() {
632 // If the connection is closing then close the output stream to 632 // If the connection is closing then close the output stream to
633 // fully close the socket. 633 // fully close the socket.
634 if (_closing) { 634 if (_closing) {
635 outputStream.close(); 635 _socket.close();
636 } 636 }
637 _response = null; 637 _response = null;
638 } 638 }
639 639
640 HttpServer _server; 640 HttpServer _server;
641 HttpRequest _request; 641 HttpRequest _request;
642 HttpResponse _response; 642 HttpResponse _response;
643 643
644 // Callbacks. 644 // Callbacks.
645 Function onRequestReceived; 645 Function onRequestReceived;
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 sockets.addFirst(socketConn); 1246 sockets.addFirst(socketConn);
1247 socketConn._markReturned(); 1247 socketConn._markReturned();
1248 } 1248 }
1249 1249
1250 Function _onOpen; 1250 Function _onOpen;
1251 Map<String, Queue<_SocketConnection>> _openSockets; 1251 Map<String, Queue<_SocketConnection>> _openSockets;
1252 Set<_SocketConnection> _activeSockets; 1252 Set<_SocketConnection> _activeSockets;
1253 Timer _evictionTimer; 1253 Timer _evictionTimer;
1254 bool _shutdown; // Has this HTTP client been shutdown? 1254 bool _shutdown; // Has this HTTP client been shutdown?
1255 } 1255 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698