aboutsummaryrefslogtreecommitdiffstats
path: root/net/http/server.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-08-18 15:16:02 +0200
committerKim Alvefur <zash@zash.se>2016-08-18 15:16:02 +0200
commit860d3a58b873ee2289a989341e22cb46ebee947b (patch)
tree224750aa24bd1f26b3e06e6f96a735c2118465e7 /net/http/server.lua
parent4c89d041878972b771a7a593f9358c6bdb17d6c7 (diff)
parent1686ef5d53d3d84d35ebebab89b8d1b22dcf021e (diff)
downloadprosody-860d3a58b873ee2289a989341e22cb46ebee947b.tar.gz
prosody-860d3a58b873ee2289a989341e22cb46ebee947b.zip
Merge 0.9->0.10
Diffstat (limited to 'net/http/server.lua')
-rw-r--r--net/http/server.lua9
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;