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

Issue 9956062: Refactor the close and error handling of HTTP connections (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

Refactor the close and error handling of HTTP connections * Unify the handling of connection close and connection error. * The HttpConnection and HttpClientConnection now have separate close/error handling * The HTTP parser gets the connection close indication as it might signal end of body for responses with no other length indication R=ajohnsen@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=6355

Patch Set 1 #

Patch Set 2 : #

Total comments: 5

Patch Set 3 : Addressed review comments #

Total comments: 8

Patch Set 4 : Addressed additional review comments #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+201 lines, -117 lines) Patch
M runtime/bin/http_impl.dart View 1 2 3 17 chunks +104 lines, -87 lines 4 comments Download
M runtime/bin/http_parser.dart View 1 2 3 12 chunks +48 lines, -12 lines 0 comments Download
M tests/standalone/src/io/HttpParserTest.dart View 7 chunks +37 lines, -4 lines 0 comments Download
M tests/standalone/src/io/HttpServerEarlyClientCloseTest.dart View 1 chunk +6 lines, -6 lines 0 comments Download
M tests/standalone/src/io/HttpServerEarlyServerCloseTest.dart View 2 chunks +4 lines, -4 lines 0 comments Download
M tests/standalone/src/io/HttpServerSocketTest.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M tests/standalone/standalone.status View 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Søren Gjesse
8 years, 8 months ago (2012-04-02 13:42:13 UTC) #1
Anders Johnsen
First small round of comments. http://codereview.chromium.org/9956062/diff/1001/runtime/bin/http_impl.dart File runtime/bin/http_impl.dart (right): http://codereview.chromium.org/9956062/diff/1001/runtime/bin/http_impl.dart#newcode506 runtime/bin/http_impl.dart:506: _onConnectionClosed(null); This is really ...
8 years, 8 months ago (2012-04-02 13:55:34 UTC) #2
Søren Gjesse
http://codereview.chromium.org/9956062/diff/1001/runtime/bin/http_impl.dart File runtime/bin/http_impl.dart (right): http://codereview.chromium.org/9956062/diff/1001/runtime/bin/http_impl.dart#newcode551 runtime/bin/http_impl.dart:551: if (e != null && onError != null) { ...
8 years, 8 months ago (2012-04-02 14:11:33 UTC) #3
Anders Johnsen
LGTM, can't wait to try this out! :) Thank you http://codereview.chromium.org/9956062/diff/9001/runtime/bin/http_impl.dart File runtime/bin/http_impl.dart (right): http://codereview.chromium.org/9956062/diff/9001/runtime/bin/http_impl.dart#newcode652 ...
8 years, 8 months ago (2012-04-03 05:36:37 UTC) #4
Anders Johnsen
https://chromiumcodereview.appspot.com/9956062/diff/9001/runtime/bin/http_parser.dart File runtime/bin/http_parser.dart (right): https://chromiumcodereview.appspot.com/9956062/diff/9001/runtime/bin/http_parser.dart#newcode463 runtime/bin/http_parser.dart:463: error(e); We should return after 'error(e)' so we don't ...
8 years, 8 months ago (2012-04-03 07:20:16 UTC) #5
Anders Johnsen
LGTM, last few comments. http://codereview.chromium.org/9956062/diff/13001/runtime/bin/http_impl.dart File runtime/bin/http_impl.dart (right): http://codereview.chromium.org/9956062/diff/13001/runtime/bin/http_impl.dart#newcode484 runtime/bin/http_impl.dart:484: if (!_error) { I think ...
8 years, 8 months ago (2012-04-10 08:18:53 UTC) #6
Søren Gjesse
8 years, 8 months ago (2012-04-10 13:10:07 UTC) #7
http://codereview.chromium.org/9956062/diff/9001/runtime/bin/http_impl.dart
File runtime/bin/http_impl.dart (right):

http://codereview.chromium.org/9956062/diff/9001/runtime/bin/http_impl.dart#n...
runtime/bin/http_impl.dart:652: _connections.remove(connection);
On 2012/04/03 05:36:37, ajohnsen wrote:
> So, here the order matters. In the future when we ask for current connections,
> do we want include this connection if called from onError. The problem is that
> it's not valid at this point.

Moved the remove up before the _onError call. In general when asking for the
current connections you can still get connections which are not valid.

http://codereview.chromium.org/9956062/diff/9001/runtime/bin/http_parser.dart
File runtime/bin/http_parser.dart (right):

http://codereview.chromium.org/9956062/diff/9001/runtime/bin/http_parser.dart...
runtime/bin/http_parser.dart:463: error(e);
On 2012/04/03 07:20:16, ajohnsen wrote:
> We should return after 'error(e)' so we don't hit both cases and reports two
> errors.

Done.

http://codereview.chromium.org/9956062/diff/9001/runtime/bin/http_parser.dart...
runtime/bin/http_parser.dart:481: error(e);
On 2012/04/03 07:20:16, ajohnsen wrote:
> Maybe return here as well, just for good measure.

Done.

Powered by Google App Engine
This is Rietveld 408576698