OLD | NEW |
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 class _HttpHeaders implements HttpHeaders { | 5 class _HttpHeaders implements HttpHeaders { |
6 _HttpHeaders() : _headers = new Map<String, List<String>>(); | 6 _HttpHeaders() : _headers = new Map<String, List<String>>(); |
7 | 7 |
8 List<String> operator[](String name) { | 8 List<String> operator[](String name) { |
9 name = name.toLowerCase(); | 9 name = name.toLowerCase(); |
10 return _headers[name]; | 10 return _headers[name]; |
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 } | 1190 } |
1191 | 1191 |
1192 void set onError(void callback(e)) { | 1192 void set onError(void callback(e)) { |
1193 _requestOrResponse._streamSetErrorHandler(callback); | 1193 _requestOrResponse._streamSetErrorHandler(callback); |
1194 } | 1194 } |
1195 | 1195 |
1196 _HttpRequestResponseBase _requestOrResponse; | 1196 _HttpRequestResponseBase _requestOrResponse; |
1197 } | 1197 } |
1198 | 1198 |
1199 | 1199 |
1200 class _HttpConnectionBase implements Hashable { | 1200 class _HttpConnectionBase { |
1201 _HttpConnectionBase() : _sendBuffers = new Queue(), | 1201 _HttpConnectionBase() : _sendBuffers = new Queue(), |
1202 _httpParser = new _HttpParser() { | 1202 _httpParser = new _HttpParser() { |
1203 _hashCode = _nextHashCode; | 1203 _hashCode = _nextHashCode; |
1204 _nextHashCode = (_nextHashCode + 1) & 0xFFFFFFF; | 1204 _nextHashCode = (_nextHashCode + 1) & 0xFFFFFFF; |
1205 } | 1205 } |
1206 | 1206 |
1207 void _connectionEstablished(Socket socket) { | 1207 void _connectionEstablished(Socket socket) { |
1208 _socket = socket; | 1208 _socket = socket; |
1209 // Register handler for socket events. | 1209 // Register handler for socket events. |
1210 _socket.onData = _onData; | 1210 _socket.onData = _onData; |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 | 2179 |
2180 | 2180 |
2181 class _RedirectInfo implements RedirectInfo { | 2181 class _RedirectInfo implements RedirectInfo { |
2182 const _RedirectInfo(int this.statusCode, | 2182 const _RedirectInfo(int this.statusCode, |
2183 String this.method, | 2183 String this.method, |
2184 Uri this.location); | 2184 Uri this.location); |
2185 final int statusCode; | 2185 final int statusCode; |
2186 final String method; | 2186 final String method; |
2187 final Uri location; | 2187 final Uri location; |
2188 } | 2188 } |
OLD | NEW |