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

Issue 10232006: Check the state of the HTTP request and response when handling headers (Closed)

Created:
8 years, 8 months ago by Søren Gjesse
Modified:
8 years, 8 months ago
Reviewers:
Anders Johnsen
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Check the state of the HTTP request and response when handling headers The HTTP headers object in request and response objects is now marked as non-mutable when it cannot be changed. An exception will be thrown if trying to mutate headers when they are not mutable. Postponed the sending of the headers until either the first byte of body data is sent or the empty body is indicated. This is to allow getting the output stream object and still be able to set headers until the actual body is touched. Added checking of the number of bytes of body data transmitted when an explicit content length is specified. R=ajohnsen@google.com BUG=none TEST=tests/standalone/src/io/HttpHeadersState.dart,tests/standalone/src/io/HttpContentLengthTest.dart Committed: https://code.google.com/p/dart/source/detail?r=7010

Patch Set 1 #

Patch Set 2 : Reverted unintentional edit #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+234 lines, -31 lines) Patch
M runtime/bin/http.dart View 1 chunk +6 lines, -2 lines 0 comments Download
M runtime/bin/http_impl.dart View 24 chunks +70 lines, -29 lines 2 comments Download
A tests/standalone/src/io/HttpContentLengthTest.dart View 1 chunk +85 lines, -0 lines 0 comments Download
A tests/standalone/src/io/HttpHeadersState.dart View 1 chunk +73 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Gjesse
8 years, 8 months ago (2012-04-26 09:16:56 UTC) #1
Anders Johnsen
LGTM! https://chromiumcodereview.appspot.com/10232006/diff/3001/runtime/bin/http_impl.dart File runtime/bin/http_impl.dart (right): https://chromiumcodereview.appspot.com/10232006/diff/3001/runtime/bin/http_impl.dart#newcode333 runtime/bin/http_impl.dart:333: _bodyBytesWritten += bytes; The "check" method here is ...
8 years, 8 months ago (2012-04-26 10:12:49 UTC) #2
Søren Gjesse
8 years, 8 months ago (2012-04-26 11:26:40 UTC) #3
https://chromiumcodereview.appspot.com/10232006/diff/3001/runtime/bin/http_im...
File runtime/bin/http_impl.dart (right):

https://chromiumcodereview.appspot.com/10232006/diff/3001/runtime/bin/http_im...
runtime/bin/http_impl.dart:333: _bodyBytesWritten += bytes;
On 2012/04/26 10:12:50, ajohnsen wrote:
> The "check" method here is mutable. Should we rename it?

Good point. Renamed to _updateContentLength.

Powered by Google App Engine
This is Rietveld 408576698