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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 case HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE: | 336 case HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE: |
337 return "Requested range not satisfiable"; | 337 return "Requested range not satisfiable"; |
338 case HttpStatus.EXPECTATION_FAILED: return "Expectation Failed"; | 338 case HttpStatus.EXPECTATION_FAILED: return "Expectation Failed"; |
339 case HttpStatus.INTERNAL_SERVER_ERROR: return "Internal Server Error"; | 339 case HttpStatus.INTERNAL_SERVER_ERROR: return "Internal Server Error"; |
340 case HttpStatus.NOT_IMPLEMENTED: return "Not Implemented"; | 340 case HttpStatus.NOT_IMPLEMENTED: return "Not Implemented"; |
341 case HttpStatus.BAD_GATEWAY: return "Bad Gateway"; | 341 case HttpStatus.BAD_GATEWAY: return "Bad Gateway"; |
342 case HttpStatus.SERVICE_UNAVAILABLE: return "Service Unavailable"; | 342 case HttpStatus.SERVICE_UNAVAILABLE: return "Service Unavailable"; |
343 case HttpStatus.GATEWAY_TIMEOUT: return "Gateway Time-out"; | 343 case HttpStatus.GATEWAY_TIMEOUT: return "Gateway Time-out"; |
344 case HttpStatus.HTTP_VERSION_NOT_SUPPORTED: | 344 case HttpStatus.HTTP_VERSION_NOT_SUPPORTED: |
345 return "Http Version not supported"; | 345 return "Http Version not supported"; |
346 default: return "Status " + statusCode.toString(); | 346 default: return "Status $statusCode"; |
347 } | 347 } |
348 } | 348 } |
349 | 349 |
350 bool _writeHeader() { | 350 bool _writeHeader() { |
351 List<int> data; | 351 List<int> data; |
352 OutputStream stream = _httpConnection.outputStream; | 352 OutputStream stream = _httpConnection.outputStream; |
353 | 353 |
354 // Write status line. | 354 // Write status line. |
355 stream.write(_Const.HTTP11); | 355 stream.write(_Const.HTTP11); |
356 _writeSP(); | 356 _writeSP(); |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 _onError = callback; | 1138 _onError = callback; |
1139 } | 1139 } |
1140 | 1140 |
1141 Function _onOpen; | 1141 Function _onOpen; |
1142 Function _onError; | 1142 Function _onError; |
1143 Map<String, Queue<_SocketConnection>> _openSockets; | 1143 Map<String, Queue<_SocketConnection>> _openSockets; |
1144 Set<_SocketConnection> _activeSockets; | 1144 Set<_SocketConnection> _activeSockets; |
1145 Timer _evictionTimer; | 1145 Timer _evictionTimer; |
1146 bool _shutdown; // Has this HTTP client been shutdown? | 1146 bool _shutdown; // Has this HTTP client been shutdown? |
1147 } | 1147 } |
OLD | NEW |