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

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

Issue 1128873011: Add handling of HTTP '100 Continue' intermediate response (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 5 years, 7 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
« no previous file with comments | « no previous file | tests/standalone/io/http_100_continue.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index 42c1db9843c22ec0041a4231469a7118a70beefe..f06179b9dd4df7e6dde383b5965d797dd67833ac 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -1289,8 +1289,24 @@ class _HttpClientConnection {
"Unexpected response (unsolicited response without request).",
uri: _currentUri);
}
- _nextResponseCompleter.complete(incoming);
- _nextResponseCompleter = null;
+
+ // Check for status code '100 Continue'. In that case just
+ // consume that response as the final response will follow
+ // it. There is currently no API for the client to wait for
+ // the '100 Continue' response.
+ if (incoming.statusCode == 100) {
+ incoming.drain().then((_) {
+ _subscription.resume();
+ }).catchError((error, [StackTrace stackTrace]) {
+ _nextResponseCompleter.completeError(
+ new HttpException(error.message, uri: _currentUri),
+ stackTrace);
+ _nextResponseCompleter = null;
+ });
+ } else {
+ _nextResponseCompleter.complete(incoming);
+ _nextResponseCompleter = null;
+ }
},
onError: (error, [StackTrace stackTrace]) {
if (_nextResponseCompleter != null) {
« no previous file with comments | « no previous file | tests/standalone/io/http_100_continue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698