summaryrefslogtreecommitdiffhomepage
path: root/libs/httpclient/luasrc
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-03-06 17:17:44 +0000
committerSteven Barth <steven@midlink.org>2009-03-06 17:17:44 +0000
commit96d988abb004f9a7f10fcf8441fe1a7399420f4b (patch)
treebbf120604abb00eb3a5a9249a83d351125a75cb3 /libs/httpclient/luasrc
parent09a18c2c31bcfe903ff3ede9654f6e351355f75e (diff)
httpclient: Improved callback support
Diffstat (limited to 'libs/httpclient/luasrc')
-rw-r--r--libs/httpclient/luasrc/httpclient/receiver.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/httpclient/luasrc/httpclient/receiver.lua b/libs/httpclient/luasrc/httpclient/receiver.lua
index 852a10db2..55503f14b 100644
--- a/libs/httpclient/luasrc/httpclient/receiver.lua
+++ b/libs/httpclient/luasrc/httpclient/receiver.lua
@@ -203,10 +203,11 @@ function request_to_file(uri, target, options, cbs)
end
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()
sock:close()
- return true
+ return true, nil, nil, unpack(stat, 2)
end
end