From 11543d22aee1b428ca4e5e8e959bf9c135c5b6ff Mon Sep 17 00:00:00 2001 From: Evgeny Karpov Date: Wed, 20 Nov 2019 16:11:49 +0300 Subject: [PATCH] Allow to terminate Recv/Send methods if fSSL was destroyed --- Lib/Protocols/IdSSLOpenSSL.pas | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/Protocols/IdSSLOpenSSL.pas b/Lib/Protocols/IdSSLOpenSSL.pas index 65ca53817..685e333f5 100644 --- a/Lib/Protocols/IdSSLOpenSSL.pas +++ b/Lib/Protocols/IdSSLOpenSSL.pas @@ -3828,6 +3828,7 @@ function TIdSSLSocket.Recv(var ABuffer: TIdBytes): Integer; ret, err: Integer; begin repeat + if fSSL = nil then Break; ret := SSL_read(fSSL, PByte(ABuffer), Length(ABuffer)); if ret > 0 then begin Result := ret; @@ -3852,6 +3853,7 @@ function TIdSSLSocket.Send(const ABuffer: TIdBytes; AOffset, ALength: Integer): begin Result := 0; repeat + if fSSL = nil then Break; ret := SSL_write(fSSL, @ABuffer[AOffset], ALength); if ret > 0 then begin Inc(Result, ret);