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

Side by Side Diff: sdk/lib/io/http_parser.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/http_utils.dart » ('j') | 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 part of dart.io; 5 part of dart.io;
6 6
7 // Global constants. 7 // Global constants.
8 class _Const { 8 class _Const {
9 // Bytes for "HTTP". 9 // Bytes for "HTTP".
10 static const HTTP = const [72, 84, 84, 80]; 10 static const HTTP = const [72, 84, 84, 80];
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 if (byte == _CharCode.CR || byte == _CharCode.LF) { 321 if (byte == _CharCode.CR || byte == _CharCode.LF) {
322 throw new HttpParserException("Invalid response reason phrase"); 322 throw new HttpParserException("Invalid response reason phrase");
323 } 323 }
324 _uri_or_reason_phrase.add(byte); 324 _uri_or_reason_phrase.add(byte);
325 } 325 }
326 break; 326 break;
327 327
328 case _State.RESPONSE_LINE_ENDING: 328 case _State.RESPONSE_LINE_ENDING:
329 _expect(byte, _CharCode.LF); 329 _expect(byte, _CharCode.LF);
330 _messageType == _MessageType.RESPONSE; 330 _messageType == _MessageType.RESPONSE;
331 _statusCode = parseInt( 331 _statusCode = int.parse(
332 new String.fromCharCodes(_method_or_status_code)); 332 new String.fromCharCodes(_method_or_status_code));
333 if (_statusCode < 100 || _statusCode > 599) { 333 if (_statusCode < 100 || _statusCode > 599) {
334 throw new HttpParserException("Invalid response status code"); 334 throw new HttpParserException("Invalid response status code");
335 } 335 }
336 _state = _State.HEADER_START; 336 _state = _State.HEADER_START;
337 break; 337 break;
338 338
339 case _State.HEADER_START: 339 case _State.HEADER_START:
340 if (byte == _CharCode.CR) { 340 if (byte == _CharCode.CR) {
341 _state = _State.HEADER_ENDING; 341 _state = _State.HEADER_ENDING;
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 Function error; 785 Function error;
786 Function closed; 786 Function closed;
787 } 787 }
788 788
789 789
790 class HttpParserException implements Exception { 790 class HttpParserException implements Exception {
791 const HttpParserException([String this.message = ""]); 791 const HttpParserException([String this.message = ""]);
792 String toString() => "HttpParserException: $message"; 792 String toString() => "HttpParserException: $message";
793 final String message; 793 final String message;
794 } 794 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/http_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698