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

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

Issue 171403003: Clean up usage of streams in http-parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « no previous file | sdk/lib/io/http_parser.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 2f852dce0b03de416ba3afb2524521945a7d0353..50b8fe2c206ca25eaaf72f92c96f72b08e72e3f2 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -1246,7 +1246,7 @@ class _HttpClientConnection {
_HttpClientConnection(this.key, this._socket, this._httpClient,
[this._proxyTunnel = false])
: _httpParser = new _HttpParser.responseParser() {
- _socket.pipe(_httpParser);
+ _httpParser.listenToStream(_socket);
// Set up handlers on the parser here, so we are sure to get 'onDone' from
// the parser.
@@ -1908,7 +1908,7 @@ class _HttpConnection extends LinkedListEntry<_HttpConnection> {
_HttpConnection(this._socket, this._httpServer)
: _httpParser = new _HttpParser.requestParser() {
_startTimeout();
- _socket.pipe(_httpParser);
+ _httpParser.listenToStream(_socket);
_subscription = _httpParser.listen(
(incoming) {
_stopTimeout();
@@ -1945,8 +1945,7 @@ class _HttpConnection extends LinkedListEntry<_HttpConnection> {
// received data was handled.
destroy();
}
- })
- .catchError((e) {
+ }, onError: (_) {
destroy();
});
response._ignoreBody = request.method == "HEAD";
« no previous file with comments | « no previous file | sdk/lib/io/http_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698