| OLD | NEW |
| 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 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 _httpParser.dataReceived = (data) => _onDataReceived(data); | 925 _httpParser.dataReceived = (data) => _onDataReceived(data); |
| 926 _httpParser.dataEnd = () => _onDataEnd(); | 926 _httpParser.dataEnd = () => _onDataEnd(); |
| 927 _httpParser.error = (e) => _onError(e); | 927 _httpParser.error = (e) => _onError(e); |
| 928 // Tell the HTTP parser the method it is expecting a response to. | 928 // Tell the HTTP parser the method it is expecting a response to. |
| 929 _httpParser.responseToMethod = _method; | 929 _httpParser.responseToMethod = _method; |
| 930 | 930 |
| 931 onDisconnect = _onDisconnected; | 931 onDisconnect = _onDisconnected; |
| 932 } | 932 } |
| 933 | 933 |
| 934 void _propagateError(Exception e) { | 934 void _propagateError(Exception e) { |
| 935 if (_response._streamErrorHandler != null) { | 935 if (_response != null && _response._streamErrorHandler != null) { |
| 936 _response._streamErrorHandler(e); | 936 _response._streamErrorHandler(e); |
| 937 } | 937 } |
| 938 } | 938 } |
| 939 | 939 |
| 940 HttpClientRequest open(String method, String uri) { | 940 HttpClientRequest open(String method, String uri) { |
| 941 _method = method; | 941 _method = method; |
| 942 _request = new _HttpClientRequest(method, uri, this); | 942 _request = new _HttpClientRequest(method, uri, this); |
| 943 _request.keepAlive = true; | 943 _request.keepAlive = true; |
| 944 _response = new _HttpClientResponse(this); | 944 _response = new _HttpClientResponse(this); |
| 945 return _request; | 945 return _request; |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 sockets.addFirst(socketConn); | 1197 sockets.addFirst(socketConn); |
| 1198 socketConn._markReturned(); | 1198 socketConn._markReturned(); |
| 1199 } | 1199 } |
| 1200 | 1200 |
| 1201 Function _onOpen; | 1201 Function _onOpen; |
| 1202 Map<String, Queue<_SocketConnection>> _openSockets; | 1202 Map<String, Queue<_SocketConnection>> _openSockets; |
| 1203 Set<_SocketConnection> _activeSockets; | 1203 Set<_SocketConnection> _activeSockets; |
| 1204 Timer _evictionTimer; | 1204 Timer _evictionTimer; |
| 1205 bool _shutdown; // Has this HTTP client been shutdown? | 1205 bool _shutdown; // Has this HTTP client been shutdown? |
| 1206 } | 1206 } |
| OLD | NEW |