diff --git a/lualib/http/tlshelper.lua b/lualib/http/tlshelper.lua index 05e3d3ae..359c423a 100644 --- a/lualib/http/tlshelper.lua +++ b/lualib/http/tlshelper.lua @@ -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