diff options
author | Kim Alvefur <zash@zash.se> | 2016-08-18 15:16:02 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-08-18 15:16:02 +0200 |
commit | 34f704bbe74beada74e2be1c1d0e4acc18a86015 (patch) | |
tree | 224750aa24bd1f26b3e06e6f96a735c2118465e7 /net/http/server.lua | |
parent | 8165818e268f3995d34bdd5f4fcf61ff196446ae (diff) | |
parent | e9341ec4139489a9490099e7d10fa411e8e01d1a (diff) | |
download | prosody-34f704bbe74beada74e2be1c1d0e4acc18a86015.tar.gz prosody-34f704bbe74beada74e2be1c1d0e4acc18a86015.zip |
Merge 0.9->0.10
Diffstat (limited to 'net/http/server.lua')
-rw-r--r-- | net/http/server.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/http/server.lua b/net/http/server.lua index ba45ede0..93bbffb4 100644 --- a/net/http/server.lua +++ b/net/http/server.lua @@ -22,6 +22,7 @@ local incomplete = {}; local listener = {}; local hosts = {}; local default_host; +local options = {}; local function is_wildcard_event(event) return event:sub(-2, -1) == "/*"; @@ -133,7 +134,10 @@ function listener.onconnect(conn) sessions[conn] = nil; conn:close(); end - sessions[conn] = parser_new(success_cb, error_cb); + local function options_cb() + return options; + end + sessions[conn] = parser_new(success_cb, error_cb, "server", options_cb); end function listener.ondisconnect(conn) @@ -350,6 +354,9 @@ end function _M.fire_event(event, ...) return events.fire_event(event, ...); end +function _M.set_option(name, value) + options[name] = value; +end _M.listener = listener; _M.codes = codes; |