From aad803ee046dd58bb925836729328df0894362be Mon Sep 17 00:00:00 2001 From: nixo Date: Wed, 28 Oct 2020 22:28:28 +0100 Subject: [PATCH] flow_control: slighly simpler logic --- src/flow_control.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/flow_control.jl b/src/flow_control.jl index 2cc8c13..6ee239c 100644 --- a/src/flow_control.jl +++ b/src/flow_control.jl @@ -15,8 +15,7 @@ function do_ssl_handshake(client) queue_encrypted_bytes(client, buf) elseif !bio_should_retry(client.wbio) return -1 - end - if n <= 0 + else break end end @@ -44,8 +43,9 @@ function do_encrypt(client) queue_encrypted_bytes(client, buf) elseif !bio_should_retry(client.wbio) return -1 + else + break end - n > 0 || break end end if status in (SSL_ERROR, SSL_SYSCALL) @@ -97,8 +97,9 @@ function on_read_cb(client, buffer) queue_encrypted_bytes(client, buf) elseif !bio_should_retry(client.wbio) return -1 + else + break end - n < 0 && break end end if status in (SSL_ERROR, SSL_SYSCALL)