Index: sdk/lib/io/secure_socket.dart |
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart |
index 44d60849c1bad597ea44f161f6b2a0baeb3e8c8e..1dfd8c5330d3793e471522c6aed1883bcb75fd1a 100644 |
--- a/sdk/lib/io/secure_socket.dart |
+++ b/sdk/lib/io/secure_socket.dart |
@@ -558,6 +558,11 @@ class _RawSecureSocket extends Stream<RawSocketEvent> |
throw new ArgumentError( |
"Subscription passed to TLS upgrade is paused"); |
} |
+ // If we are upgrading a socket that is already closed for read, |
+ // report an error as if we received READ_CLOSED during the handshake. |
+ if (_socket._socket.closedReadEventSent) { |
+ _eventDispatcher(RawSocketEvent.READ_CLOSED); |
+ } |
_socketSubscription |
..onData(_eventDispatcher) |
..onError(_reportError) |