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

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

Issue 170843010: Fix secure socket filter after edge-triggering. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | no next file » | 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 241da82cbbbede6f58e2dec65357b9bab9418de6..b966c61bb676e30fba59043ffbe18e96e8449573 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -895,6 +895,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
_secureFilter = null;
return;
}
+ _socket.readEventsEnabled = true;
if (_filterStatus.writeEmpty && _closedWrite && !_socketClosedWrite) {
// Checks for and handles all cases of partially closed sockets.
shutdown(SocketDirection.SEND);
@@ -948,6 +949,8 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
var buffer = _secureFilter.buffers[READ_ENCRYPTED];
if (buffer.writeFromSource(_readSocketOrBufferedData) > 0) {
_filterStatus.readEmpty = false;
+ } else {
+ _socket.readEventsEnabled = false;
}
}
@@ -1165,7 +1168,7 @@ class _ExternalBuffer {
int written = 0;
int toWrite = linearFree;
// Loop over zero, one, or two linear data ranges.
- do {
+ while (toWrite > 0) {
// Source returns at most toWrite bytes, and it returns null when empty.
var inputData = getData(toWrite);
if (inputData == null || inputData.length == 0) break;
@@ -1174,7 +1177,7 @@ class _ExternalBuffer {
advanceEnd(len);
written += len;
toWrite = linearFree;
- } while (toWrite > 0);
+ }
return written;
}
« 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