aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-11-06 01:54:58 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-11-06 01:54:58 +0500
commit30c65df5d6c20faba29e476e9048e1db153571ff (patch)
tree493a3e98e751db296f9053802add2f7b42040224 /util
parent412be2f3dfc56e255b619a1ac8c0fd61e71c3ea8 (diff)
downloadprosody-30c65df5d6c20faba29e476e9048e1db153571ff.tar.gz
prosody-30c65df5d6c20faba29e476e9048e1db153571ff.zip
util.httpstream: Added support for an options callback, to allow passing per-message options to the parser.
Diffstat (limited to 'util')
-rw-r--r--util/httpstream.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/httpstream.lua b/util/httpstream.lua
index fac38d81..c96abe22 100644
--- a/util/httpstream.lua
+++ b/util/httpstream.lua
@@ -7,7 +7,7 @@ coroutine.resume(deadroutine);
module("httpstream")
-local function parser(success_cb, parser_type)
+local function parser(success_cb, parser_type, options_cb)
local data = coroutine.yield();
local function readline()
local pos = data:find("\r\n", nil, true);
@@ -93,9 +93,9 @@ local function parser(success_cb, parser_type)
else coroutine.yield("unknown-parser-type"); end
end
-function new(success_cb, error_cb, parser_type)
+function new(success_cb, error_cb, parser_type, options_cb)
local co = coroutine.create(parser);
- coroutine.resume(co, success_cb, parser_type)
+ coroutine.resume(co, success_cb, parser_type, options_cb)
return {
feed = function(self, data)
if not data then