| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 // Global constants. | 7 // Global constants. |
| 8 class _Const { | 8 class _Const { |
| 9 // Bytes for "HTTP". | 9 // Bytes for "HTTP". |
| 10 static const HTTP = const [72, 84, 84, 80]; | 10 static const HTTP = const [72, 84, 84, 80]; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 32, 9, 13, 10]; | 27 32, 9, 13, 10]; |
| 28 } | 28 } |
| 29 | 29 |
| 30 | 30 |
| 31 // Frequently used character codes. | 31 // Frequently used character codes. |
| 32 class _CharCode { | 32 class _CharCode { |
| 33 static const int HT = 9; | 33 static const int HT = 9; |
| 34 static const int LF = 10; | 34 static const int LF = 10; |
| 35 static const int CR = 13; | 35 static const int CR = 13; |
| 36 static const int SP = 32; | 36 static const int SP = 32; |
| 37 static const int AMPERSAND = 38; |
| 37 static const int COMMA = 44; | 38 static const int COMMA = 44; |
| 38 static const int DASH = 45; | 39 static const int DASH = 45; |
| 39 static const int SLASH = 47; | 40 static const int SLASH = 47; |
| 40 static const int ZERO = 48; | 41 static const int ZERO = 48; |
| 41 static const int ONE = 49; | 42 static const int ONE = 49; |
| 42 static const int COLON = 58; | 43 static const int COLON = 58; |
| 43 static const int SEMI_COLON = 59; | 44 static const int SEMI_COLON = 59; |
| 45 static const int EQUAL = 61; |
| 44 } | 46 } |
| 45 | 47 |
| 46 | 48 |
| 47 // States of the HTTP parser state machine. | 49 // States of the HTTP parser state machine. |
| 48 class _State { | 50 class _State { |
| 49 static const int START = 0; | 51 static const int START = 0; |
| 50 static const int METHOD_OR_RESPONSE_HTTP_VERSION = 1; | 52 static const int METHOD_OR_RESPONSE_HTTP_VERSION = 1; |
| 51 static const int RESPONSE_HTTP_VERSION = 2; | 53 static const int RESPONSE_HTTP_VERSION = 2; |
| 52 static const int REQUEST_LINE_METHOD = 3; | 54 static const int REQUEST_LINE_METHOD = 3; |
| 53 static const int REQUEST_LINE_URI = 4; | 55 static const int REQUEST_LINE_URI = 4; |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 StreamController<_HttpIncoming> _controller; | 964 StreamController<_HttpIncoming> _controller; |
| 963 StreamController<List<int>> _bodyController; | 965 StreamController<List<int>> _bodyController; |
| 964 } | 966 } |
| 965 | 967 |
| 966 | 968 |
| 967 class HttpParserException implements Exception { | 969 class HttpParserException implements Exception { |
| 968 const HttpParserException([String this.message = ""]); | 970 const HttpParserException([String this.message = ""]); |
| 969 String toString() => "HttpParserException: $message"; | 971 String toString() => "HttpParserException: $message"; |
| 970 final String message; | 972 final String message; |
| 971 } | 973 } |
| OLD | NEW |