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

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

Issue 23253004: Fix error in SecureSocket, remove failing status from tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/secure_socket.dart
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index 18670502cf2c448ff7392687bc1ce014cba92d44..09160238bb01461e99d6a00906d00a21a5970476 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -441,7 +441,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
bool _closedWrite = false; // The secure socket has been closed for writing.
Completer _closeCompleter = new Completer(); // The network socket is gone.
_FilterStatus _filterStatus = new _FilterStatus();
- bool _connectPending = false;
+ bool _connectPending = true;
bool _filterPending = false;
bool _filterActive = false;
@@ -526,7 +526,6 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
futureSocket = new Future.value(socket);
}
futureSocket.then((rawSocket) {
- _connectPending = true;
_socket = rawSocket;
_socket.readEventsEnabled = true;
_socket.writeEventsEnabled = false;
@@ -775,8 +774,9 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
if (_status == CLOSED) {
return;
} else if (_connectPending) {
- // _connectPending is true after the underlying connection has been
- // made, but before the handshake has completed.
+ // _connectPending is true until the handshake has completed, and the
+ // _handshakeComplete future returned from SecureSocket.connect has
+ // completed. Before this point, we must complete it with an error.
_handshakeComplete.completeError(e);
} else {
_controller.addError(e);
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698