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

Issue 11453006: Fix a number of HTTP issues (Closed)

Created:
8 years ago by Søren Gjesse
Modified:
8 years ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix a number of HTTP issues The main purpose of this change is to ensure that the HTTP server does not start sending the response before the full request have been read. This ended up requiring a number of changes. 1. Handle server closing connection before full request is read If the server closes the connection before the request body have been read this will result in the underlying socket getting closed by the server. 2. Support writing to output stream before full request is read Changed the server to not start sending data before the full request have been read. In order to still make it possible to write to the request output stream before reading all data any data written before will be buffered. When the request have been fully read the buffered data will be written. 3. Handle of bad/closed connections retreived from the client connection pool When a HTTP client connection is pulled from the pool of keep alive connections there can be situations where this connection has just been closed by the server. This is now mittigated by trying to make a new connection when this happens. It is only possible to actually create a new connection if no body has been sent. 4. Forward request headers when redirecting Both for manual and automatic rediretion any request headers set on the original request are now set on the redirect request as well. 5. Invalidate sockets in the client pool if required Open HTTP socket connections in the client pool are now invalidated and closed if there is any activify on them while they are idle. R=ager@google.com, ajohnsen@google.com BUG=6984 Committed: https://code.google.com/p/dart/source/detail?r=15782

Patch Set 1 #

Total comments: 15
Unified diffs Side-by-side diffs Delta from patch set Stats (+260 lines, -53 lines) Patch
M sdk/lib/io/http_impl.dart View 14 chunks +170 lines, -45 lines 14 comments Download
M sdk/lib/io/http_parser.dart View 2 chunks +8 lines, -4 lines 0 comments Download
M sdk/lib/io/secure_socket.dart View 1 chunk +1 line, -1 line 1 comment Download
M sdk/lib/io/socket_stream_impl.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/standalone/io/http_client_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/http_redirect_test.dart View 4 chunks +78 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Søren Gjesse
8 years ago (2012-12-05 13:24:24 UTC) #1
Mads Ager (google)
LGTM https://codereview.chromium.org/11453006/diff/1/sdk/lib/io/http_impl.dart File sdk/lib/io/http_impl.dart (right): https://codereview.chromium.org/11453006/diff/1/sdk/lib/io/http_impl.dart#newcode820 sdk/lib/io/http_impl.dart:820: void _releaseBuffer() { Maybe name this something like ...
8 years ago (2012-12-05 16:02:18 UTC) #2
Bob Nystrom
Drive-by comments: 1. This sounds fantastic! Making HTTP more robust especially in error cases makes ...
8 years ago (2012-12-05 18:27:50 UTC) #3
Søren Gjesse
Bob, Regarding testing then this is already tested by existing tests. We already had several ...
8 years ago (2012-12-06 17:23:08 UTC) #4
Bob Nystrom
8 years ago (2012-12-06 17:47:31 UTC) #5
Message was sent while issue was closed.
On 2012/12/06 17:23:08, Søren Gjesse wrote:
> Bob,
> 
> Regarding testing then this is already tested by existing tests. We already
had
> several tests doing 1. and 2. and with these changes they are still working.
> Some tests then revealed 3. which I then fixed. 4. is tested by two new
redirect
> tests. However 5. is not tested and I will add a test for that.

Awesome, sounds great!

- bob

Powered by Google App Engine
This is Rietveld 408576698