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

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

Issue 91223002: Add support for Websocket protocols. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix selecting invalid protocol and document. Created 7 years 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/socket_patch.dart ('k') | sdk/lib/io/websocket.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) 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
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
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 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | sdk/lib/io/websocket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698