# HG changeset patch
# User Waqas Hussain <waqas20@gmail.com>
# Date 1288990498 -18000
# Node ID 75d287daad16cdd092d632428102c7bd5bfb058f
# Parent  e2cc09e83a3ef3775e52ac549d36545c09343202
util.httpstream: Added support for an options callback, to allow passing per-message options to the parser.

diff -r e2cc09e83a3e -r 75d287daad16 util/httpstream.lua
--- a/util/httpstream.lua	Sat Nov 06 01:08:30 2010 +0500
+++ b/util/httpstream.lua	Sat Nov 06 01:54:58 2010 +0500
@@ -7,7 +7,7 @@
 
 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 @@
 	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