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

Issue 10008083: Add HTTP/1.0 support and simplify persistent connections handling (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

Add HTTP/1.0 support and simplify persistent connections handling The HTTP parser now recognized both HTTP/1.1 and HTTP/1.0 in request and response headers. The only difference between the handling of HTTP 1.1 and HTTP 1.0 is in the decection of persistent connections. For HTTP 1.1 persistent connections are the default and for HTTP 1.0 persistent connections are speficified throught the "Connection: Keep-Alive" header. Removed the getters and setters for keepAlive from all the interfaces. They are not of much use and persistent connection handling should be transparent. The HTTP client currently always sends requests using HTTP 1.1 and in the reare cases where one wants the connection to be closed after the request adding the header "Connection: close" should work. With this change using wget to get resources from the chat server. R=ajohnsen@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=6509

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+195 lines, -125 lines) Patch
M runtime/bin/http.dart View 4 chunks +0 lines, -22 lines 0 comments Download
M runtime/bin/http_impl.dart View 16 chunks +30 lines, -33 lines 0 comments Download
M runtime/bin/http_parser.dart View 13 chunks +121 lines, -51 lines 2 comments Download
M runtime/bin/io.dart View 1 chunk +1 line, -0 lines 0 comments Download
M samples/chat/chat_server_lib.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/standalone/src/io/HttpClientTest.dart View 2 chunks +0 lines, -2 lines 2 comments Download
M tests/standalone/src/io/HttpParserTest.dart View 10 chunks +41 lines, -15 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Gjesse
8 years, 8 months ago (2012-04-12 16:59:22 UTC) #1
Anders Johnsen
LGTM, very nice. https://chromiumcodereview.appspot.com/10008083/diff/1/runtime/bin/http_parser.dart File runtime/bin/http_parser.dart (right): https://chromiumcodereview.appspot.com/10008083/diff/1/runtime/bin/http_parser.dart#newcode386 runtime/bin/http_parser.dart:386: } else if (headerField == "transfer-encoding" ...
8 years, 8 months ago (2012-04-13 09:02:37 UTC) #2
Søren Gjesse
8 years, 8 months ago (2012-04-13 10:58:31 UTC) #3
https://chromiumcodereview.appspot.com/10008083/diff/1/runtime/bin/http_parse...
File runtime/bin/http_parser.dart (right):

https://chromiumcodereview.appspot.com/10008083/diff/1/runtime/bin/http_parse...
runtime/bin/http_parser.dart:386: } else if (headerField == "transfer-encoding"
&&
On 2012/04/13 09:02:38, ajohnsen wrote:
> toLowerCase here as well. Actually, maybe we should change the definition of
> headerField to say toLowerCase?

This is not required. When the header name is parsed it is turned into lower
case. The header value is not as it can be case dependent.

https://chromiumcodereview.appspot.com/10008083/diff/1/tests/standalone/src/i...
File tests/standalone/src/io/HttpClientTest.dart (left):

https://chromiumcodereview.appspot.com/10008083/diff/1/tests/standalone/src/i...
tests/standalone/src/io/HttpClientTest.dart:14: request.keepAlive = false;
On 2012/04/13 09:02:38, ajohnsen wrote:
> Since you have changed keepAlive to be on by default, should we do something
> else in this test?

I don't think so. I don't even know why it was here in the first place.

Powered by Google App Engine
This is Rietveld 408576698