summaryrefslogtreecommitdiffhomepage
path: root/libs/web
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-07-25 07:27:05 +0000
committerSteven Barth <steven@midlink.org>2009-07-25 07:27:05 +0000
commitb8ab3b9dacab9c6d4344c60fdb4046087a24f233 (patch)
tree2d374430d2ef1919336061f3d5481e732f01d7ae /libs/web
parent3194662054cebfefc48c7ff3d3a5d7a3aa988b9a (diff)
Add: luci.http.splice to allow direct copying of data from a file
descriptor
Diffstat (limited to 'libs/web')
-rw-r--r--libs/web/luasrc/http.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/web/luasrc/http.lua b/libs/web/luasrc/http.lua
index bac997952..d34e253a5 100644
--- a/libs/web/luasrc/http.lua
+++ b/libs/web/luasrc/http.lua
@@ -258,6 +258,13 @@ function write(content, src_err)
end
end
+--- Splice data from a filedescriptor to the client.
+-- @param fp File descriptor
+-- @param size Bytes to splice (optional)
+function splice(fd, size)
+ coroutine.yield(6, fd, size)
+end
+
--- Redirects the client to a new URL and closes the connection.
-- @param url Target URL
function redirect(url)