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

Issue 11498010: Improve the handling of HTTP requests with empty body (Closed)

Created:
8 years ago by Søren Gjesse
Modified:
8 years ago
Reviewers:
Mads Ager (google)
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Improve the handling of HTTP requests with empty body The HTTP parser always issues a "request received" event and a "data end" event for all requests including requests with an empty body. The "request received" event causes the request handler to be called and the "data end" event causes the onClosed on the input stream to be called. If the output stream was before the "data end" event (that is in the request handler) the HTTP server would close the socket as the output stream was closed before the input was read. However for requests with empty bodies this is not really the case. The HTTP server now tracks when a request is known to have an empty body. When that is the case there is no need to buffer the response data and closing the output stream bedore the "data end" event is now handled as if the full request is already read - which it is. The method _checkDone is how called exactly once for each of the "request received", "data" and "data end" events, and always as the last thing before returning from handling the evnent. R=ager@google.com BUG=dart:6984, dart:7182 Committed: https://code.google.com/p/dart/source/detail?r=15951

Patch Set 1 #

Patch Set 2 : Update status file #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -38 lines) Patch
M sdk/lib/io/http_impl.dart View 9 chunks +17 lines, -10 lines 2 comments Download
M sdk/lib/io/http_parser.dart View 4 chunks +19 lines, -21 lines 0 comments Download
M tests/standalone/io/http_parser_test.dart View 5 chunks +10 lines, -6 lines 0 comments Download
M tests/standalone/standalone.status View 1 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Gjesse
8 years ago (2012-12-10 13:59:36 UTC) #1
Mads Ager (google)
LGTM https://codereview.chromium.org/11498010/diff/3001/sdk/lib/io/http_impl.dart File sdk/lib/io/http_impl.dart (right): https://codereview.chromium.org/11498010/diff/3001/sdk/lib/io/http_impl.dart#newcode1624 sdk/lib/io/http_impl.dart:1624: bool hasBody) { indentation off by 1 space?
8 years ago (2012-12-11 07:04:34 UTC) #2
Søren Gjesse
8 years ago (2012-12-11 07:26:31 UTC) #3
https://codereview.chromium.org/11498010/diff/3001/sdk/lib/io/http_impl.dart
File sdk/lib/io/http_impl.dart (right):

https://codereview.chromium.org/11498010/diff/3001/sdk/lib/io/http_impl.dart#...
sdk/lib/io/http_impl.dart:1624: bool hasBody) {
On 2012/12/11 07:04:34, Mads Ager wrote:
> indentation off by 1 space?

Done.

Powered by Google App Engine
This is Rietveld 408576698