| 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 const HTTP = const [72, 84, 84, 80]; | 8 static const HTTP = const [72, 84, 84, 80]; |
| 9 // Bytes for "HTTP/1.". | 9 // Bytes for "HTTP/1.". |
| 10 static const HTTP1DOT = const [72, 84, 84, 80, 47, 49, 46]; | 10 static const HTTP1DOT = const [72, 84, 84, 80, 47, 49, 46]; |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 return; | 592 return; |
| 593 } | 593 } |
| 594 throw e; | 594 throw e; |
| 595 } | 595 } |
| 596 } | 596 } |
| 597 | 597 |
| 598 String get version { | 598 String get version { |
| 599 switch (_httpVersion) { | 599 switch (_httpVersion) { |
| 600 case _HttpVersion.HTTP10: | 600 case _HttpVersion.HTTP10: |
| 601 return "1.0"; | 601 return "1.0"; |
| 602 break; | |
| 603 case _HttpVersion.HTTP11: | 602 case _HttpVersion.HTTP11: |
| 604 return "1.1"; | 603 return "1.1"; |
| 605 break; | |
| 606 } | 604 } |
| 607 return null; | 605 return null; |
| 608 } | 606 } |
| 609 | 607 |
| 610 int get messageType => _messageType; | 608 int get messageType => _messageType; |
| 611 int get contentLength => _contentLength; | 609 int get contentLength => _contentLength; |
| 612 bool get upgrade => _connectionUpgrade && _state == _State.UPGRADED; | 610 bool get upgrade => _connectionUpgrade && _state == _State.UPGRADED; |
| 613 bool get persistentConnection => _persistentConnection; | 611 bool get persistentConnection => _persistentConnection; |
| 614 | 612 |
| 615 void set responseToMethod(String method) { _responseToMethod = method; } | 613 void set responseToMethod(String method) { _responseToMethod = method; } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 Function dataEnd; | 715 Function dataEnd; |
| 718 Function error; | 716 Function error; |
| 719 } | 717 } |
| 720 | 718 |
| 721 | 719 |
| 722 class HttpParserException implements Exception { | 720 class HttpParserException implements Exception { |
| 723 const HttpParserException([String this.message = ""]); | 721 const HttpParserException([String this.message = ""]); |
| 724 String toString() => "HttpParserException: $message"; | 722 String toString() => "HttpParserException: $message"; |
| 725 final String message; | 723 final String message; |
| 726 } | 724 } |
| OLD | NEW |