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

Issue 11410003: Refactoring of the HTTP library (Closed)

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

Description

Refactoring of the HTTP library Better state handling: On both server and client the state of the connection is tracked. This goes for both the HTTP request/response state (idle, active, done) and the socket state (open, read closed, write closed). Simplified the socket event handling: All socket onData, onClosed and onError events go directly to the HTTP parser. The HTTP connection only receives events from the HTTP parser now. Better close handling: A close queue have been added where sockets which should be closed are added. When in the close queue the socket will be closed when either all data from the output stream are written or an error occours. Changed the HTTP parser to parse either requests or responses. Removed the null-checks in the HTTP parser for whether the callbacks where set. The HTTP parser is only used internally and we always set all callbacks. Whether it fixes the bugs listed below still needs to be verified through thorough testing on all platforms. However the code should be in much better shape from this refactoring. R=ager@google.com BUG=dart:6393, dart:6521, dart:6594 Committed: https://code.google.com/p/dart/source/detail?r=14840

Patch Set 1 #

Patch Set 2 : Revers accidental edits #

Total comments: 6

Patch Set 3 : Addressed review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+341 lines, -286 lines) Patch
M sdk/lib/io/http_impl.dart View 1 2 28 chunks +249 lines, -216 lines 0 comments Download
M sdk/lib/io/http_parser.dart View 17 chunks +68 lines, -52 lines 0 comments Download
M tests/standalone/io/http_connection_close_test.dart View 3 chunks +10 lines, -6 lines 0 comments Download
M tests/standalone/io/http_parser_test.dart View 11 chunks +14 lines, -10 lines 0 comments Download
M tests/standalone/standalone.status View 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Søren Gjesse
8 years, 1 month ago (2012-11-09 12:39:40 UTC) #1
Mads Ager (google)
This looks a lot cleaner! One question below about potential socket double-close. https://codereview.chromium.org/11410003/diff/2001/sdk/lib/io/http_impl.dart File sdk/lib/io/http_impl.dart ...
8 years, 1 month ago (2012-11-12 09:03:29 UTC) #2
Søren Gjesse
https://codereview.chromium.org/11410003/diff/2001/sdk/lib/io/http_impl.dart File sdk/lib/io/http_impl.dart (right): https://codereview.chromium.org/11410003/diff/2001/sdk/lib/io/http_impl.dart#newcode611 sdk/lib/io/http_impl.dart:611: // peer. closed. On 2012/11/12 09:03:29, Mads Ager wrote: ...
8 years, 1 month ago (2012-11-12 12:36:37 UTC) #3
Søren Gjesse
After having looked into the closing I think that the current implementation is correct. When ...
8 years, 1 month ago (2012-11-13 10:23:41 UTC) #4
Mads Ager (google)
8 years, 1 month ago (2012-11-13 10:31:21 UTC) #5
LGTM

Powered by Google App Engine
This is Rietveld 408576698