From 30c65df5d6c20faba29e476e9048e1db153571ff Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sat, 6 Nov 2010 01:54:58 +0500 Subject: util.httpstream: Added support for an options callback, to allow passing per-message options to the parser. --- util/httpstream.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util') 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 -- cgit v1.2.3