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

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

Issue 108323003: Ignore HandshakeExceptions in HttpServer, as they are request(socket)-bound and not fatal for the s… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test. Created 7 years 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/https_server_test.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 756db6020b7b1bcf3212599c8a4469c9eeed9bd3..4c6e74b862dcc67a34a825c5389fa0fbe972a65c 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -586,7 +586,8 @@ class _HttpOutboundConsumer implements StreamConsumer {
}
bool _ignoreError(error)
- => error is SocketException && _outbound is HttpResponse;
+ => (error is SocketException || error is TlsException) &&
+ _outbound is HttpResponse;
_ensureController() {
if (_controller != null) return;
@@ -2055,7 +2056,13 @@ class _HttpServer extends Stream<HttpRequest> implements HttpServer {
_HttpConnection connection = new _HttpConnection(socket, this);
_connections.add(connection);
},
- onError: _controller.addError,
+ onError: (error) {
+ // Ignore HandshakeExceptions as they are bound to a single request,
+ // and are not fatal for the server.
+ if (error is! HandshakeException) {
+ _controller.addError(error);
+ }
+ },
onDone: _controller.close);
return _controller.stream.listen(onData,
onError: onError,
« no previous file with comments | « no previous file | tests/standalone/io/https_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698