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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
616 new HttpParserException( | 616 new HttpParserException( |
617 "Connection closed before full body was received")); | 617 "Connection closed before full body was received")); |
618 } | 618 } |
619 } | 619 } |
620 | 620 |
621 void streamError(e) { | 621 void streamError(e) { |
622 // Don't report errors when HTTP parser is in idle state. Clients | 622 // Don't report errors when HTTP parser is in idle state. Clients |
623 // can close the connection and cause a connection reset by peer | 623 // can close the connection and cause a connection reset by peer |
624 // error which is OK. | 624 // error which is OK. |
625 if (_state == _State.START) { | 625 if (_state == _State.START) { |
626 print("$_requestParser $e"); | |
Mads Ager (google)
2012/11/20 08:04:28
Remove debug print.
Søren Gjesse
2012/11/20 08:15:11
Done.
| |
627 | |
626 closed(); | 628 closed(); |
627 return; | 629 return; |
628 } | 630 } |
629 error(e); | 631 error(e); |
630 } | 632 } |
631 | 633 |
632 String get version { | 634 String get version { |
633 switch (_httpVersion) { | 635 switch (_httpVersion) { |
634 case _HttpVersion.HTTP10: | 636 case _HttpVersion.HTTP10: |
635 return "1.0"; | 637 return "1.0"; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
766 Function error; | 768 Function error; |
767 Function closed; | 769 Function closed; |
768 } | 770 } |
769 | 771 |
770 | 772 |
771 class HttpParserException implements Exception { | 773 class HttpParserException implements Exception { |
772 const HttpParserException([String this.message = ""]); | 774 const HttpParserException([String this.message = ""]); |
773 String toString() => "HttpParserException: $message"; | 775 String toString() => "HttpParserException: $message"; |
774 final String message; | 776 final String message; |
775 } | 777 } |
OLD | NEW |