Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: runtime/bin/http_parser.dart

Issue 9834043: Fix HTTP library issues reported by dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/http_impl.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/1.0". 7 // Bytes for "HTTP/1.0".
8 static final HTTP10 = const [72, 84, 84, 80, 47, 49, 46, 48]; 8 static final HTTP10 = const [72, 84, 84, 80, 47, 49, 46, 48];
9 // Bytes for "HTTP/1.1". 9 // Bytes for "HTTP/1.1".
10 static final HTTP11 = const [72, 84, 84, 80, 47, 49, 46, 49]; 10 static final HTTP11 = const [72, 84, 84, 80, 47, 49, 46, 49];
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 498
499 int _expectHexDigit(int byte) { 499 int _expectHexDigit(int byte) {
500 if (0x30 <= byte && byte <= 0x39) { 500 if (0x30 <= byte && byte <= 0x39) {
501 return byte - 0x30; // 0 - 9 501 return byte - 0x30; // 0 - 9
502 } else if (0x41 <= byte && byte <= 0x46) { 502 } else if (0x41 <= byte && byte <= 0x46) {
503 return byte - 0x41 + 10; // A - F 503 return byte - 0x41 + 10; // A - F
504 } else if (0x61 <= byte && byte <= 0x66) { 504 } else if (0x61 <= byte && byte <= 0x66) {
505 return byte - 0x61 + 10; // a - f 505 return byte - 0x61 + 10; // a - f
506 } else { 506 } else {
507 throw new HttpParserException("Failed to parse HTTP"); 507 throw new HttpParserException("Failed to parse HTTP");
508 return 0;
509 } 508 }
510 } 509 }
511 510
512 int _state; 511 int _state;
513 int _httpVersionIndex; 512 int _httpVersionIndex;
514 int _messageType; 513 int _messageType;
515 StringBuffer _method_or_status_code; 514 StringBuffer _method_or_status_code;
516 StringBuffer _uri_or_reason_phrase; 515 StringBuffer _uri_or_reason_phrase;
517 StringBuffer _headerField; 516 StringBuffer _headerField;
518 StringBuffer _headerValue; 517 StringBuffer _headerValue;
(...skipping 15 matching lines...) Expand all
534 Function dataEnd; 533 Function dataEnd;
535 Function error; 534 Function error;
536 } 535 }
537 536
538 537
539 class HttpParserException implements Exception { 538 class HttpParserException implements Exception {
540 const HttpParserException([String this.message = ""]); 539 const HttpParserException([String this.message = ""]);
541 String toString() => "HttpParserException: $message"; 540 String toString() => "HttpParserException: $message";
542 final String message; 541 final String message;
543 } 542 }
OLDNEW
« no previous file with comments | « runtime/bin/http_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698