diff options
author | Steven Barth <steven@midlink.org> | 2009-07-25 07:27:05 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2009-07-25 07:27:05 +0000 |
commit | b8ab3b9dacab9c6d4344c60fdb4046087a24f233 (patch) | |
tree | 2d374430d2ef1919336061f3d5481e732f01d7ae /libs/web/luasrc/http.lua | |
parent | 3194662054cebfefc48c7ff3d3a5d7a3aa988b9a (diff) |
Add: luci.http.splice to allow direct copying of data from a file
descriptor
Diffstat (limited to 'libs/web/luasrc/http.lua')
-rw-r--r-- | libs/web/luasrc/http.lua | 7 |
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) |