mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-16 13:59:55 +02:00
Changed receive function. Now uniform with all other functions. Returns nil
on error, return partial result in the end. http.lua rewritten.
This commit is contained in:
@ -171,9 +171,8 @@ function sink.file(handle, io_err)
|
||||
return function(chunk, err)
|
||||
if not chunk then
|
||||
handle:close()
|
||||
return nil, err
|
||||
end
|
||||
return handle:write(chunk)
|
||||
return 1
|
||||
else return handle:write(chunk) end
|
||||
end
|
||||
else return sink.error(io_err or "unable to open file") end
|
||||
end
|
||||
|
Reference in New Issue
Block a user