mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +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
|
end
|
||||||
|
|
||||||
function tlshelper.readfunc(fd, tls_ctx)
|
function tlshelper.readfunc(fd, tls_ctx)
|
||||||
local readfunc = socket.readfunc(fd)
|
local function readfunc()
|
||||||
|
readfunc = socket.readfunc(fd)
|
||||||
|
return ""
|
||||||
|
end
|
||||||
local read_buff = ""
|
local read_buff = ""
|
||||||
return function (sz)
|
return function (sz)
|
||||||
if not sz then
|
if not sz then
|
||||||
local s = ""
|
local s = ""
|
||||||
if #read_buff == 0 then
|
if #read_buff == 0 then
|
||||||
local ds = readfunc(sz)
|
local ds = readfunc()
|
||||||
s = tls_ctx:read(ds)
|
s = tls_ctx:read(ds)
|
||||||
end
|
end
|
||||||
s = read_buff .. s
|
s = read_buff .. s
|
||||||
|
|||||||
Reference in New Issue
Block a user