| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |