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

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

Issue 12334119: Fix issus 8828 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 9 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 | « no previous file | tests/standalone/io/regress_8828_test.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 class _HttpIncoming 7 class _HttpIncoming
8 extends Stream<List<int>> implements StreamSink<List<int>> { 8 extends Stream<List<int>> implements StreamSink<List<int>> {
9 final int _transferLength; 9 final int _transferLength;
10 final Completer _dataCompleter = new Completer(); 10 final Completer _dataCompleter = new Completer();
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 if (_ignoreBody) return new Future.immediate(this); 339 if (_ignoreBody) return new Future.immediate(this);
340 if (_chunked) { 340 if (_chunked) {
341 // Transform when chunked. 341 // Transform when chunked.
342 stream = stream.transform(new _ChunkedTransformer()); 342 stream = stream.transform(new _ChunkedTransformer());
343 } 343 }
344 return super.consume(stream).then((_) => this); 344 return super.consume(stream).then((_) => this);
345 } 345 }
346 346
347 void add(List<int> data) { 347 void add(List<int> data) {
348 _writeHeaders(); 348 _writeHeaders();
349 if (_ignoreBody) return; 349 if (_ignoreBody || data.length == 0) return;
350 if (_chunked) { 350 if (_chunked) {
351 _ChunkedTransformer._addChunk(data, super.add); 351 _ChunkedTransformer._addChunk(data, super.add);
352 } else { 352 } else {
353 super.add(data); 353 super.add(data);
354 } 354 }
355 } 355 }
356 356
357 void close() { 357 void close() {
358 if (!_headersWritten && !_ignoreBody && headers.chunkedTransferEncoding) { 358 if (!_headersWritten && !_ignoreBody && headers.chunkedTransferEncoding) {
359 // If no body was written, _ignoreBody is false (it's not a HEAD 359 // If no body was written, _ignoreBody is false (it's not a HEAD
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1601 1601
1602 1602
1603 class _RedirectInfo implements RedirectInfo { 1603 class _RedirectInfo implements RedirectInfo {
1604 const _RedirectInfo(int this.statusCode, 1604 const _RedirectInfo(int this.statusCode,
1605 String this.method, 1605 String this.method,
1606 Uri this.location); 1606 Uri this.location);
1607 final int statusCode; 1607 final int statusCode;
1608 final String method; 1608 final String method;
1609 final Uri location; 1609 final Uri location;
1610 } 1610 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/regress_8828_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698