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

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

Issue 1842703003: Fixes handling of short reads/writes for Mac SSL (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 4 years, 9 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 | « runtime/bin/secure_socket_macos.cc ('k') | 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 c271d77794f12673e56372aed54a7ba0279b3739..07ef23ea1482b1a0ce80bda09b8fe706001193b4 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -842,7 +842,9 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
}
void _tryFilter() {
- if (_status == CLOSED) return;
+ if (_status == CLOSED) {
+ return;
+ }
if (_filterPending && !_filterActive) {
_filterActive = true;
_filterPending = false;
@@ -858,7 +860,9 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
if (_filterStatus.writeEmpty && _closedWrite && !_socketClosedWrite) {
// Checks for and handles all cases of partially closed sockets.
shutdown(SocketDirection.SEND);
- if (_status == CLOSED) return;
+ if (_status == CLOSED) {
+ return;
+ }
}
if (_filterStatus.readEmpty && _socketClosedRead && !_closedRead) {
if (_status == HANDSHAKE) {
@@ -870,14 +874,26 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
}
_closeHandler();
}
- if (_status == CLOSED) return;
+ if (_status == CLOSED) {
+ return;
+ }
if (_filterStatus.progress) {
_filterPending = true;
- if (_filterStatus.writePlaintextNoLongerFull) _sendWriteEvent();
- if (_filterStatus.readEncryptedNoLongerFull) _readSocket();
- if (_filterStatus.writeEncryptedNoLongerEmpty) _writeSocket();
- if (_filterStatus.readPlaintextNoLongerEmpty) _scheduleReadEvent();
- if (_status == HANDSHAKE) _secureHandshake();
+ if (_filterStatus.writeEncryptedNoLongerEmpty) {
+ _writeSocket();
+ }
+ if (_filterStatus.writePlaintextNoLongerFull) {
+ _sendWriteEvent();
+ }
+ if (_filterStatus.readEncryptedNoLongerFull) {
+ _readSocket();
+ }
+ if (_filterStatus.readPlaintextNoLongerEmpty) {
+ _scheduleReadEvent();
+ }
+ if (_status == HANDSHAKE) {
+ _secureHandshake();
+ }
}
_tryFilter();
}).catchError(_reportError);
« no previous file with comments | « runtime/bin/secure_socket_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698