httpclient: Improved callback support
This commit is contained in:
parent
09a18c2c31
commit
96d988abb0
1 changed files with 3 additions and 2 deletions
|
@ -203,10 +203,11 @@ function request_to_file(uri, target, options, cbs)
|
||||||
end
|
end
|
||||||
|
|
||||||
if cbs.on_header then
|
if cbs.on_header then
|
||||||
if cbs.on_header(file, code, resp) == false then
|
local stat = {cbs.on_header(file, code, resp)}
|
||||||
|
if stat[1] == false then
|
||||||
file:close()
|
file:close()
|
||||||
sock:close()
|
sock:close()
|
||||||
return true
|
return true, nil, nil, unpack(stat, 2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue