| 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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 break; | 605 break; |
| 606 } | 606 } |
| 607 return null; | 607 return null; |
| 608 } | 608 } |
| 609 | 609 |
| 610 int get messageType() => _messageType; | 610 int get messageType() => _messageType; |
| 611 int get contentLength() => _contentLength; | 611 int get contentLength() => _contentLength; |
| 612 bool get upgrade() => _connectionUpgrade && _state == _State.UPGRADED; | 612 bool get upgrade() => _connectionUpgrade && _state == _State.UPGRADED; |
| 613 bool get persistentConnection() => _persistentConnection; | 613 bool get persistentConnection() => _persistentConnection; |
| 614 | 614 |
| 615 void set responseToMethod(String method) { _responseToMethod = method; } | 615 void set responseToMethod(String method) => _responseToMethod = method; |
| 616 | 616 |
| 617 bool get isIdle() => _state == _State.START; | 617 bool get isIdle() => _state == _State.START; |
| 618 | 618 |
| 619 List<int> get unparsedData() => _unparsedData; | 619 List<int> get unparsedData() => _unparsedData; |
| 620 | 620 |
| 621 void _bodyEnd() { | 621 void _bodyEnd() { |
| 622 if (dataEnd != null) { | 622 if (dataEnd != null) { |
| 623 dataEnd(_messageType == _MessageType.RESPONSE && !_persistentConnection); | 623 dataEnd(_messageType == _MessageType.RESPONSE && !_persistentConnection); |
| 624 } | 624 } |
| 625 } | 625 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 Function dataEnd; | 717 Function dataEnd; |
| 718 Function error; | 718 Function error; |
| 719 } | 719 } |
| 720 | 720 |
| 721 | 721 |
| 722 class HttpParserException implements Exception { | 722 class HttpParserException implements Exception { |
| 723 const HttpParserException([String this.message = ""]); | 723 const HttpParserException([String this.message = ""]); |
| 724 String toString() => "HttpParserException: $message"; | 724 String toString() => "HttpParserException: $message"; |
| 725 final String message; | 725 final String message; |
| 726 } | 726 } |
| OLD | NEW |