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

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

Issue 11411121: Generate an error for active connections when the HTTP client is shutdown (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed long line Created 8 years, 1 month 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 c4e966e31bcc7ddbcf7a139e600ff1ea86a19949..1acd7ebe3a958a3bc829e327600206fb2cf452cd 100644
--- a/sdk/lib/io/http_parser.dart
+++ b/sdk/lib/io/http_parser.dart
@@ -582,6 +582,8 @@ class _HttpParser {
}
void streamDone() {
+ String type() => _requestParser ? "request" : "response";
+
// If the connection is idle the HTTP stream is closed.
if (_state == _State.START) {
if (_requestParser) {
@@ -589,7 +591,7 @@ class _HttpParser {
} else {
error(
new HttpParserException(
- "Connection closed before full header was received"));
+ "Connection closed before full ${type()} header was received"));
}
return;
}
@@ -600,7 +602,7 @@ class _HttpParser {
// throw the error.
error(
new HttpParserException(
- "Connection closed before full header was received"));
+ "Connection closed before full ${type()} header was received"));
return;
}
@@ -614,7 +616,7 @@ class _HttpParser {
// throw the error.
error(
new HttpParserException(
- "Connection closed before full body was received"));
+ "Connection closed before full ${type()} body was received"));
}
}

Powered by Google App Engine
This is Rietveld 408576698