projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
httpclient: callback can abort download
[project/luci.git]
/
libs
/
httpclient
/
luasrc
/
httpclient
/
receiver.lua
diff --git
a/libs/httpclient/luasrc/httpclient/receiver.lua
b/libs/httpclient/luasrc/httpclient/receiver.lua
index
c977d06
..
852a10d
100644
(file)
--- a/
libs/httpclient/luasrc/httpclient/receiver.lua
+++ b/
libs/httpclient/luasrc/httpclient/receiver.lua
@@
-203,7
+203,11
@@
function request_to_file(uri, target, options, cbs)
end
if cbs.on_header then
- cbs.on_header(file, code, resp)
+ if cbs.on_header(file, code, resp) == false then
+ file:close()
+ sock:close()
+ return true
+ end
end
local chunked = resp.headers["Transfer-Encoding"] == "chunked"