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

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

Issue 12320088: dart:io: Prevent initial WRITE event on RawSecureSocket when writeEventsEnabled is set to false. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | 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 333edd12b3532b572275ed0767e32a52647880b1..c1f40db91ed87817ace2ad5633e1ae8b445d4660 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -386,6 +386,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
void set writeEventsEnabled(bool value) {
if (value &&
+ _controller.hasSubscribers &&
Søren Gjesse 2013/02/25 07:20:44 What about paused?
Bill Hesse 2013/02/25 07:32:36 It should be legal to enqueue a WRITE event if the
Søren Gjesse 2013/02/25 14:50:54 I agree that it is not an error to send WRITE even
_secureFilter != null &&
_secureFilter.buffers[WRITE_PLAINTEXT].free > 0) {
new Timer(0, (_) => _controller.add(RawSocketEvent.WRITE));
@@ -489,6 +490,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
_secureHandshake();
} catch (e) { _reportError(e, "RawSecureSocket error"); }
} else if (_status == CONNECTED &&
+ _controller.hasSubscribers &&
Søren Gjesse 2013/02/25 07:20:44 Ditto.
_writeEventsEnabled &&
_secureFilter.buffers[WRITE_PLAINTEXT].free > 0) {
// Reset the one-shot handler.
« 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