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

Unified Diff: runtime/bin/http_impl.dart

Issue 10454051: Small HTTP server fixes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/http_impl.dart
diff --git a/runtime/bin/http_impl.dart b/runtime/bin/http_impl.dart
index 4e47b262b5ac8a12703160d4c2258c63ab4207b6..8b16bdd3d521d04544fa28eab1427989cc89e1ef 100644
--- a/runtime/bin/http_impl.dart
+++ b/runtime/bin/http_impl.dart
@@ -1049,7 +1049,7 @@ class _HttpResponse extends _HttpRequestResponseBase implements HttpResponse {
// Determine the value of the "Transfer-Encoding" header based on
// whether the content length is known.
- if (_contentLength > 0) {
+ if (_contentLength >= 0) {
_headers.set(HttpHeaders.CONTENT_LENGTH, _contentLength.toString());
} else if (_contentLength < 0) {
_headers.set(HttpHeaders.TRANSFER_ENCODING, "chunked");
@@ -1343,10 +1343,7 @@ class _HttpConnection extends _HttpConnectionBase {
}
void _onDataEnd(bool close) {
- if (_request != null) {
- _request._onDataEnd();
- }
- _request = null;
+ _request._onDataEnd();
}
void _responseDone() {
@@ -1463,9 +1460,7 @@ class _HttpServer implements HttpServer {
_defaultHandler(request, response);
} else {
response.statusCode = HttpStatus.NOT_FOUND;
- if (request.protocolVersion == "1.0") {
- response.contentLength = 0;
- }
+ response.contentLength = 0;
response.outputStream.close();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698