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

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

Issue 11447013: Correctly handle optional length in HTTP output stream writeFrom (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « no previous file | tests/standalone/io/regress_7097_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) 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 // The close queue handles graceful closing of HTTP connections. When 5 // The close queue handles graceful closing of HTTP connections. When
6 // a connection is added to the queue it will enter a wait state 6 // a connection is added to the queue it will enter a wait state
7 // waiting for all data written and possibly socket shutdown from 7 // waiting for all data written and possibly socket shutdown from
8 // peer. 8 // peer.
9 class _CloseQueue { 9 class _CloseQueue {
10 _CloseQueue() : _q = new Set<_HttpConnectionBase>(); 10 _CloseQueue() : _q = new Set<_HttpConnectionBase>();
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 676
677 677
678 class _HttpOutputStream extends _BaseOutputStream implements OutputStream { 678 class _HttpOutputStream extends _BaseOutputStream implements OutputStream {
679 _HttpOutputStream(_HttpRequestResponseBase this._requestOrResponse); 679 _HttpOutputStream(_HttpRequestResponseBase this._requestOrResponse);
680 680
681 bool write(List<int> buffer, [bool copyBuffer = true]) { 681 bool write(List<int> buffer, [bool copyBuffer = true]) {
682 return _requestOrResponse._streamWrite(buffer, copyBuffer); 682 return _requestOrResponse._streamWrite(buffer, copyBuffer);
683 } 683 }
684 684
685 bool writeFrom(List<int> buffer, [int offset = 0, int len]) { 685 bool writeFrom(List<int> buffer, [int offset = 0, int len]) {
686 if (offset < 0 || offset >= buffer.length) throw new ArgumentError();
687 len = len != null ? len : buffer.length - offset;
688 if (len < 0) throw new ArgumentError();
686 return _requestOrResponse._streamWriteFrom(buffer, offset, len); 689 return _requestOrResponse._streamWriteFrom(buffer, offset, len);
687 } 690 }
688 691
689 void flush() { 692 void flush() {
690 _requestOrResponse._streamFlush(); 693 _requestOrResponse._streamFlush();
691 } 694 }
692 695
693 void close() { 696 void close() {
694 _requestOrResponse._streamClose(); 697 _requestOrResponse._streamClose();
695 } 698 }
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after
2150 2153
2151 2154
2152 class _RedirectInfo implements RedirectInfo { 2155 class _RedirectInfo implements RedirectInfo {
2153 const _RedirectInfo(int this.statusCode, 2156 const _RedirectInfo(int this.statusCode,
2154 String this.method, 2157 String this.method,
2155 Uri this.location); 2158 Uri this.location);
2156 final int statusCode; 2159 final int statusCode;
2157 final String method; 2160 final String method;
2158 final Uri location; 2161 final Uri location;
2159 } 2162 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/regress_7097_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698