mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
If no content-length, read all. see issue #431
This commit is contained in:
@@ -72,7 +72,8 @@ local function request(fd, method, host, url, recvheader, header, content)
|
||||
body = body .. padding
|
||||
end
|
||||
else
|
||||
body = nil
|
||||
-- no content-length, read all
|
||||
body = body .. socket.readall(fd)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ function sockethelper.readfunc(fd)
|
||||
end
|
||||
end
|
||||
|
||||
sockethelper.readall = socket.readall
|
||||
|
||||
function sockethelper.writefunc(fd)
|
||||
return function(content)
|
||||
local ok = writebytes(fd, content)
|
||||
|
||||
Reference in New Issue
Block a user