mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +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
|
body = body .. padding
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
body = nil
|
-- no content-length, read all
|
||||||
|
body = body .. socket.readall(fd)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ function sockethelper.readfunc(fd)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sockethelper.readall = socket.readall
|
||||||
|
|
||||||
function sockethelper.writefunc(fd)
|
function sockethelper.writefunc(fd)
|
||||||
return function(content)
|
return function(content)
|
||||||
local ok = writebytes(fd, content)
|
local ok = writebytes(fd, content)
|
||||||
|
|||||||
Reference in New Issue
Block a user