Browse Source

* Fix by Dokkie8844 to treat error codes by GnuTLS in a more graceful manner. Fixes issue #40195

Michaël Van Canneyt 1 year ago
parent
commit
8e024b2606
1 changed files with 6 additions and 2 deletions
  1. 6 2
      packages/gnutls/src/gnutlssockets.pp

+ 6 - 2
packages/gnutls/src/gnutlssockets.pp

@@ -588,7 +588,9 @@ Var
 
 
 begin
 begin
   P:=PByte(@Buffer);
   P:=PByte(@Buffer);
-  Result:=Check(gnutls_record_send(Fsession,P,Count));
+  repeat
+    Result:=Check(gnutls_record_send(FSession,P,Count));
+  until (Result <> GNUTLS_E_AGAIN) and (Result <> GNUTLS_E_INTERRUPTED);
   if Result<0 then
   if Result<0 then
     Result:=-1;
     Result:=-1;
 end;
 end;
@@ -600,7 +602,9 @@ Var
 
 
 begin
 begin
   P:=PByte(@Buffer);
   P:=PByte(@Buffer);
-  Result:=Check(gnutls_record_recv(FSession,P,Count));
+  repeat
+    Result:=Check(gnutls_record_recv(FSession,P,Count));
+  until (Result <> GNUTLS_E_AGAIN) and (Result <> GNUTLS_E_INTERRUPTED);
   if Result<0 then
   if Result<0 then
     Result:=-1;
     Result:=-1;
 end;
 end;