| 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 // Global constants. | 5 // Global constants. |
| 6 class _Const { | 6 class _Const { |
| 7 // Bytes for "HTTP". | 7 // Bytes for "HTTP". |
| 8 static final HTTP = const [72, 84, 84, 80]; | 8 static final HTTP = const [72, 84, 84, 80]; |
| 9 // Bytes for "HTTP/1.". | 9 // Bytes for "HTTP/1.". |
| 10 static final HTTP1DOT = const [72, 84, 84, 80, 47, 49, 46]; | 10 static final HTTP1DOT = const [72, 84, 84, 80, 47, 49, 46]; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 | 28 |
| 29 // Frequently used character codes. | 29 // Frequently used character codes. |
| 30 class _CharCode { | 30 class _CharCode { |
| 31 static final int HT = 9; | 31 static final int HT = 9; |
| 32 static final int LF = 10; | 32 static final int LF = 10; |
| 33 static final int CR = 13; | 33 static final int CR = 13; |
| 34 static final int SP = 32; | 34 static final int SP = 32; |
| 35 static final int COMMA = 44; | 35 static final int COMMA = 44; |
| 36 static final int DASH = 45; |
| 36 static final int SLASH = 47; | 37 static final int SLASH = 47; |
| 37 static final int ZERO = 48; | 38 static final int ZERO = 48; |
| 38 static final int ONE = 49; | 39 static final int ONE = 49; |
| 39 static final int COLON = 58; | 40 static final int COLON = 58; |
| 40 static final int SEMI_COLON = 59; | 41 static final int SEMI_COLON = 59; |
| 41 } | 42 } |
| 42 | 43 |
| 43 | 44 |
| 44 // States of the HTTP parser state machine. | 45 // States of the HTTP parser state machine. |
| 45 class _State { | 46 class _State { |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 Function dataEnd; | 710 Function dataEnd; |
| 710 Function error; | 711 Function error; |
| 711 } | 712 } |
| 712 | 713 |
| 713 | 714 |
| 714 class HttpParserException implements Exception { | 715 class HttpParserException implements Exception { |
| 715 const HttpParserException([String this.message = ""]); | 716 const HttpParserException([String this.message = ""]); |
| 716 String toString() => "HttpParserException: $message"; | 717 String toString() => "HttpParserException: $message"; |
| 717 final String message; | 718 final String message; |
| 718 } | 719 } |
| OLD | NEW |