mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-24 06:39:36 +02:00
SSL sockets: propagate socket error on SSL_ERROR_SYSCALL (SSL_ERROR_SYSCALL means an error happened on the underlying socket)
This commit is contained in:
parent
75338da133
commit
38537fe27f
@ -305,6 +305,7 @@ function TOpenSSLSocketHandler.Send(Const Buffer; Count: Integer): Integer;
|
||||
var
|
||||
e: integer;
|
||||
begin
|
||||
FLastError:=0;
|
||||
FSSLLastError := 0;
|
||||
FSSLLastErrorString:='';
|
||||
repeat
|
||||
@ -314,7 +315,11 @@ begin
|
||||
if (E=SSL_ERROR_ZERO_RETURN) then
|
||||
Result:=0
|
||||
else if (e<>0) then
|
||||
begin
|
||||
FSSLLastError:=e;
|
||||
if e=SSL_ERROR_SYSCALL then
|
||||
FLastError:=socketerror;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TOpenSSLSocketHandler.Recv(Const Buffer; Count: Integer): Integer;
|
||||
@ -322,6 +327,7 @@ function TOpenSSLSocketHandler.Recv(Const Buffer; Count: Integer): Integer;
|
||||
var
|
||||
e: integer;
|
||||
begin
|
||||
FLastError:=0;
|
||||
FSSLLastError:=0;
|
||||
FSSLLastErrorString:= '';
|
||||
repeat
|
||||
@ -333,7 +339,11 @@ begin
|
||||
if (E=SSL_ERROR_ZERO_RETURN) then
|
||||
Result:=0
|
||||
else if (e<>0) then
|
||||
begin
|
||||
FSSLLastError:=e;
|
||||
if e=SSL_ERROR_SYSCALL then
|
||||
FLastError:=socketerror;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TOpenSSLSocketHandler.BytesAvailable: Integer;
|
||||
|
Loading…
Reference in New Issue
Block a user