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

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

Issue 173683002: Slightly speed up http-parser and http-header-writing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Limit status code length. Created 6 years, 10 months 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') | sdk/lib/io/http_parser.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 const int _HEADERS_BUFFER_SIZE = 8 * 1024; 7 const int _HEADERS_BUFFER_SIZE = 8 * 1024;
8 8
9 class _HttpIncoming extends Stream<List<int>> { 9 class _HttpIncoming extends Stream<List<int>> {
10 final int _transferLength; 10 final int _transferLength;
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 request.headers.set(HttpHeaders.AUTHORIZATION, "Basic $auth"); 1326 request.headers.set(HttpHeaders.AUTHORIZATION, "Basic $auth");
1327 } else { 1327 } else {
1328 // Look for credentials. 1328 // Look for credentials.
1329 creds = _httpClient._findCredentials(uri); 1329 creds = _httpClient._findCredentials(uri);
1330 if (creds != null) { 1330 if (creds != null) {
1331 creds.authorize(request); 1331 creds.authorize(request);
1332 } 1332 }
1333 } 1333 }
1334 // Start sending the request (lazy, delayed until the user provides 1334 // Start sending the request (lazy, delayed until the user provides
1335 // data). 1335 // data).
1336 _httpParser.responseToMethod = method; 1336 _httpParser.isHead = method == "HEAD";
1337 _streamFuture = outgoing.done 1337 _streamFuture = outgoing.done
1338 .then((s) { 1338 .then((s) {
1339 // Request sent, set up response completer. 1339 // Request sent, set up response completer.
1340 _nextResponseCompleter = new Completer(); 1340 _nextResponseCompleter = new Completer();
1341 1341
1342 // Listen for response. 1342 // Listen for response.
1343 _nextResponseCompleter.future 1343 _nextResponseCompleter.future
1344 .then((incoming) { 1344 .then((incoming) {
1345 _currentUri = null; 1345 _currentUri = null;
1346 incoming.dataDone.then((closing) { 1346 incoming.dataDone.then((closing) {
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
2568 const _RedirectInfo(this.statusCode, this.method, this.location); 2568 const _RedirectInfo(this.statusCode, this.method, this.location);
2569 } 2569 }
2570 2570
2571 String _getHttpVersion() { 2571 String _getHttpVersion() {
2572 var version = Platform.version; 2572 var version = Platform.version;
2573 // Only include major and minor version numbers. 2573 // Only include major and minor version numbers.
2574 int index = version.indexOf('.', version.indexOf('.') + 1); 2574 int index = version.indexOf('.', version.indexOf('.') + 1);
2575 version = version.substring(0, index); 2575 version = version.substring(0, index);
2576 return 'Dart/$version (dart:io)'; 2576 return 'Dart/$version (dart:io)';
2577 } 2577 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_headers.dart ('k') | sdk/lib/io/http_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698