Browse Source

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

Michaël Van Canneyt 1 năm trước cách đây
mục cha
commit
8e024b2606
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      packages/gnutls/src/gnutlssockets.pp

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

@@ -588,7 +588,9 @@ Var
 
 begin
   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
     Result:=-1;
 end;
@@ -600,7 +602,9 @@ Var
 
 begin
   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
     Result:=-1;
 end;