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

Unified Diff: sdk/lib/io/http_parser.dart

Issue 12314065: Reset http-parser instead of only setting _state, when we have handled a full request-response conv… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/io/http_parser.dart
diff --git a/sdk/lib/io/http_parser.dart b/sdk/lib/io/http_parser.dart
index 587d89e67ca39f0fd3e0e09cb7f79e9f75171720..7dc258eb38a2727dfa1d12d4cefcddc684a0582e 100644
--- a/sdk/lib/io/http_parser.dart
+++ b/sdk/lib/io/http_parser.dart
@@ -566,7 +566,7 @@ class _HttpParser
} else if (_transferLength == 0 ||
(_messageType == _MessageType.RESPONSE &&
(_noMessageBody || _responseToMethod == "HEAD"))) {
- _state = _State.START;
+ _reset();
var tmp = _incoming;
_closeIncoming();
_controller.add(tmp);
@@ -625,7 +625,7 @@ class _HttpParser
case _State.CHUNKED_BODY_DONE_LF:
_expect(byte, _CharCode.LF);
- _state = _State.START;
+ _reset();
_closeIncoming();
break;
@@ -650,7 +650,7 @@ class _HttpParser
_index += data.length;
if (_remainingContent == 0) {
if (!_chunked) {
- _state = _State.START;
+ _reset();
_closeIncoming();
} else {
_state = _State.CHUNK_SIZE_STARTING_CR;
« no previous file with comments | « no previous file | tests/standalone/io/http_keep_alive_test.dart » ('j') | tests/standalone/io/http_keep_alive_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698