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

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

Issue 9863035: Avoid double reporting of errors to HTTPServer onError callback (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 void _onDataEnd() { 602 void _onDataEnd() {
603 // Phase might already have gone to PHASE_IDLE if the response is 603 // Phase might already have gone to PHASE_IDLE if the response is
604 // sent without waiting for request body. 604 // sent without waiting for request body.
605 if (_phase == PHASE_REQUEST) { 605 if (_phase == PHASE_REQUEST) {
606 _phase = PHASE_RESPONSE; 606 _phase = PHASE_RESPONSE;
607 } 607 }
608 _request._onDataEnd(); 608 _request._onDataEnd();
609 } 609 }
610 610
611 void _propagateError(Exception e) { 611 void _propagateError(Exception e) {
612 if (_server._onError != null) {
613 _server._onError(e);
614 }
615 if (_request != null && _request._streamErrorHandler != null) { 612 if (_request != null && _request._streamErrorHandler != null) {
616 _request._streamErrorHandler(e); 613 _request._streamErrorHandler(e);
617 } 614 }
618 if (_response != null && _response._streamErrorHandler != null) { 615 if (_response != null && _response._streamErrorHandler != null) {
619 _response._streamErrorHandler(e); 616 _response._streamErrorHandler(e);
620 } 617 }
621 } 618 }
622 619
623 HttpServer _server; 620 HttpServer _server;
624 HttpRequest _request; 621 HttpRequest _request;
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 sockets.addFirst(socketConn); 1194 sockets.addFirst(socketConn);
1198 socketConn._markReturned(); 1195 socketConn._markReturned();
1199 } 1196 }
1200 1197
1201 Function _onOpen; 1198 Function _onOpen;
1202 Map<String, Queue<_SocketConnection>> _openSockets; 1199 Map<String, Queue<_SocketConnection>> _openSockets;
1203 Set<_SocketConnection> _activeSockets; 1200 Set<_SocketConnection> _activeSockets;
1204 Timer _evictionTimer; 1201 Timer _evictionTimer;
1205 bool _shutdown; // Has this HTTP client been shutdown? 1202 bool _shutdown; // Has this HTTP client been shutdown?
1206 } 1203 }
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