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

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

Issue 59703010: Don't create lower-case copies of already lower-case header names, in http parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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_headers.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 if (headerField == "transfer-encoding" && 516 if (headerField == "transfer-encoding" &&
517 headerValue.toLowerCase() == "chunked") { 517 headerValue.toLowerCase() == "chunked") {
518 _chunked = true; 518 _chunked = true;
519 } 519 }
520 if (headerField == "connection") { 520 if (headerField == "connection") {
521 List<String> tokens = _tokenizeFieldValue(headerValue); 521 List<String> tokens = _tokenizeFieldValue(headerValue);
522 for (int i = 0; i < tokens.length; i++) { 522 for (int i = 0; i < tokens.length; i++) {
523 if (tokens[i].toLowerCase() == "upgrade") { 523 if (tokens[i].toLowerCase() == "upgrade") {
524 _connectionUpgrade = true; 524 _connectionUpgrade = true;
525 } 525 }
526 _headers.add(headerField, tokens[i]); 526 _headers._add(headerField, tokens[i]);
527 } 527 }
528 } else { 528 } else {
529 _headers.add(headerField, headerValue); 529 _headers._add(headerField, headerValue);
530 } 530 }
531 _headerField.clear(); 531 _headerField.clear();
532 _headerValue.clear(); 532 _headerValue.clear();
533 533
534 if (byte == _CharCode.CR) { 534 if (byte == _CharCode.CR) {
535 _state = _State.HEADER_ENDING; 535 _state = _State.HEADER_ENDING;
536 } else { 536 } else {
537 // Start of new header field. 537 // Start of new header field.
538 _headerField.add(_toLowerCase(byte)); 538 _headerField.add(_toLowerCase(byte));
539 _state = _State.HEADER_FIELD; 539 _state = _State.HEADER_FIELD;
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 _HttpHeaders _headers; 983 _HttpHeaders _headers;
984 984
985 // The current incoming connection. 985 // The current incoming connection.
986 _HttpIncoming _incoming; 986 _HttpIncoming _incoming;
987 StreamSubscription _socketSubscription; 987 StreamSubscription _socketSubscription;
988 bool _paused = true; 988 bool _paused = true;
989 bool _bodyPaused = false; 989 bool _bodyPaused = false;
990 StreamController<_HttpIncoming> _controller; 990 StreamController<_HttpIncoming> _controller;
991 StreamController<List<int>> _bodyController; 991 StreamController<List<int>> _bodyController;
992 } 992 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_headers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698