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

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

Issue 18029005: dart:io | Handle an immediately closed connection in RawSecureServerSocket. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/secure_server_socket.dart
diff --git a/sdk/lib/io/secure_server_socket.dart b/sdk/lib/io/secure_server_socket.dart
index e9da3c665a4ef7b292415e7d7cae5110250698a7..8ae021eb168752615864556b3fddfe90ad0c53cc 100644
--- a/sdk/lib/io/secure_server_socket.dart
+++ b/sdk/lib/io/secure_server_socket.dart
@@ -212,9 +212,17 @@ class RawSecureServerSocket extends Stream<RawSecureSocket> {
}
void _onData(RawSocket connection) {
+ var remotePort;
+ try {
+ remotePort = connection.remotePort;
+ } catch (e) {
+ // If connection is already closed, remotePort throws an exception.
+ // Do nothing - connection is closed.
+ return;
+ }
_RawSecureSocket.connect(
connection.address,
- connection.remotePort,
+ remotePort,
certificateName,
is_server: true,
socket: connection,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698