* luci/libs: http.protocol: prevent oversized read blocks when reading from socket or file handle
This commit is contained in:
parent
15fbb8799e
commit
77da39e776
1 changed files with 2 additions and 2 deletions
|
@ -520,9 +520,9 @@ function _linereader( obj, bufsz )
|
||||||
elseif type(obj) == "userdata" and ( type(obj.receive) == "function" or type(obj.read) == "function" ) then
|
elseif type(obj) == "userdata" and ( type(obj.receive) == "function" or type(obj.read) == "function" ) then
|
||||||
|
|
||||||
if type(obj.read) == "function" then
|
if type(obj.read) == "function" then
|
||||||
__read = function() return obj:read( bufsz ) end
|
__read = function() return obj:read( bufsz - #_buf ) end
|
||||||
else
|
else
|
||||||
__read = function() return obj:receive( bufsz ) end
|
__read = function() return obj:receive( bufsz - #_buf ) end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- object is a function
|
-- object is a function
|
||||||
|
|
Loading…
Reference in a new issue