Chromium Code Reviews| Index: sdk/lib/io/http.dart |
| diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart |
| index db973dd4a906a6c4227fd24bd3d0629f58afce5b..ebd3c66edbef6cd0fc37ecd6bbe60f46dee44960 100644 |
| --- a/sdk/lib/io/http.dart |
| +++ b/sdk/lib/io/http.dart |
| @@ -175,6 +175,20 @@ abstract class HttpServer implements Stream<HttpRequest> { |
| */ |
| Duration idleTimeout; |
| + |
| + /** |
| + * Get or set if the HttpServer should buffer output, by default. |
| + * |
| + * This setting is also changable at the individual [HttpResponse]s. |
| + * |
| + * Default is `true`. |
| + * |
| + * __Note__: Disabling buffering of the output can result in very poor |
| + * performance, when writing many small chunks. |
| + */ |
| + bool bufferOutput; |
|
Søren Gjesse
2014/04/08 11:54:25
Do we need this default? I assume this will only b
Anders Johnsen
2014/04/08 12:40:07
Good point. Will remove this one.
|
| + |
| + |
| /** |
| * Starts listening for HTTP requests on the specified [address] and |
| * [port]. |
| @@ -1083,6 +1097,16 @@ abstract class HttpResponse implements IOSink { |
| Duration deadline; |
| /** |
| + * Get or set if the [HttpResponse] should buffer output. |
| + * |
| + * Default value is that of [HttpServer.bufferOutput]. |
| + * |
| + * __Note__: Disabling buffering of the output can result in very poor |
| + * performance, when writing many small chunks. |
| + */ |
| + bool bufferOutput; |
| + |
| + /** |
| * Returns the response headers. |
| * |
| * The response headers can be modified until the response body is |
| @@ -1564,6 +1588,16 @@ abstract class HttpClientRequest implements IOSink { |
| int contentLength; |
| /** |
| + * Get or set if the [HttpClientRequest] should buffer output. |
| + * |
| + * Default value is `true`. |
| + * |
| + * __Note__: Disabling buffering of the output can result in very poor |
| + * performance, when writing many small chunks. |
| + */ |
| + bool bufferOutput; |
| + |
| + /** |
| * Returns the client request headers. |
| * |
| * The client request headers can be modified until the client |
| @@ -1605,7 +1639,7 @@ abstract class HttpClientRequest implements IOSink { |
| * the data and be notified when the entire body is received. |
| * |
| * new HttpClient().get('localhost', 80, '/file.txt') |
| - * .then((HttpClientRequeset request) => request.close()) |
| + * .then((HttpClientRequest request) => request.close()) |
| * .then((HttpClientResponse response) { |
| * response.transform(UTF8.decoder).listen((contents) { |
| * // handle data |