From b8ab3b9dacab9c6d4344c60fdb4046087a24f233 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sat, 25 Jul 2009 07:27:05 +0000 Subject: Add: luci.http.splice to allow direct copying of data from a file descriptor --- libs/web/luasrc/http.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs/web') 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) -- cgit v1.2.3