瀏覽代碼

* Fix bug #36443, patch from Andrew H. Allow non-blocking read

git-svn-id: trunk@43693 -
michael 5 年之前
父節點
當前提交
46fa6d9bf5
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      packages/openssl/src/opensslsockets.pp

+ 2 - 0
packages/openssl/src/opensslsockets.pp

@@ -298,6 +298,8 @@ begin
   repeat
     Result:=FSSL.Read(@Buffer ,Count);
     e:=FSSL.GetError(Result);
+    if (e=SSL_ERROR_WANT_READ) and (Socket.IOTimeout>0) then
+      e:=SSL_ERROR_ZERO_RETURN;
   until Not (e in [SSL_ERROR_WANT_READ,SSL_ERROR_WANT_WRITE]);
   if (E=SSL_ERROR_ZERO_RETURN) then
     Result:=0