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 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 | 835 |
836 _releaseBuffer() { | 836 _releaseBuffer() { |
837 _buffer = null; | 837 _buffer = null; |
838 _index = null; | 838 _index = null; |
839 } | 839 } |
840 | 840 |
841 bool _isTokenChar(int byte) { | 841 bool _isTokenChar(int byte) { |
842 return byte > 31 && byte < 128 && !_Const.SEPARATOR_MAP[byte]; | 842 return byte > 31 && byte < 128 && !_Const.SEPARATOR_MAP[byte]; |
843 } | 843 } |
844 | 844 |
845 List<String> _tokenizeFieldValue(String headerValue) { | 845 static List<String> _tokenizeFieldValue(String headerValue) { |
846 List<String> tokens = new List<String>(); | 846 List<String> tokens = new List<String>(); |
847 int start = 0; | 847 int start = 0; |
848 int index = 0; | 848 int index = 0; |
849 while (index < headerValue.length) { | 849 while (index < headerValue.length) { |
850 if (headerValue[index] == ",") { | 850 if (headerValue[index] == ",") { |
851 tokens.add(headerValue.substring(start, index)); | 851 tokens.add(headerValue.substring(start, index)); |
852 start = index + 1; | 852 start = index + 1; |
853 } else if (headerValue[index] == " " || headerValue[index] == "\t") { | 853 } else if (headerValue[index] == " " || headerValue[index] == "\t") { |
854 start++; | 854 start++; |
855 } | 855 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 _HttpHeaders _headers; | 986 _HttpHeaders _headers; |
987 | 987 |
988 // The current incoming connection. | 988 // The current incoming connection. |
989 _HttpIncoming _incoming; | 989 _HttpIncoming _incoming; |
990 StreamSubscription _socketSubscription; | 990 StreamSubscription _socketSubscription; |
991 bool _paused = true; | 991 bool _paused = true; |
992 bool _bodyPaused = false; | 992 bool _bodyPaused = false; |
993 StreamController<_HttpIncoming> _controller; | 993 StreamController<_HttpIncoming> _controller; |
994 StreamController<List<int>> _bodyController; | 994 StreamController<List<int>> _bodyController; |
995 } | 995 } |
OLD | NEW |