mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
* fix #1494 socket read阻塞问题 * 优化readfunc Co-authored-by: zixun <lb151450@alibaba-inc.com>
This commit is contained in:
@@ -43,13 +43,16 @@ function tlshelper.closefunc(tls_ctx)
|
||||
end
|
||||
|
||||
function tlshelper.readfunc(fd, tls_ctx)
|
||||
local readfunc = socket.readfunc(fd)
|
||||
local function readfunc()
|
||||
readfunc = socket.readfunc(fd)
|
||||
return ""
|
||||
end
|
||||
local read_buff = ""
|
||||
return function (sz)
|
||||
if not sz then
|
||||
local s = ""
|
||||
if #read_buff == 0 then
|
||||
local ds = readfunc(sz)
|
||||
local ds = readfunc()
|
||||
s = tls_ctx:read(ds)
|
||||
end
|
||||
s = read_buff .. s
|
||||
|
||||
Reference in New Issue
Block a user