libs/web: fix various issues in cbi option error handling, call validator for missing...
[project/luci.git] / libs / web / luasrc / http.lua
index c5a85ea..d34e253 100644 (file)
@@ -25,7 +25,7 @@ limitations under the License.
 ]]--
 
 local ltn12 = require "luci.ltn12"
-local proto = require "luci.http.protocol"
+local protocol = require "luci.http.protocol"
 local util  = require "luci.util"
 local string = require "string"
 local coroutine = require "coroutine"
@@ -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)