changeset 1248:69f7840923f5

mod_srvinjection: Make the map a shared table so that other plugins can use/modify it
author daurnimator <quae@daurnimator.com>
date Tue, 10 Dec 2013 23:15:15 +0000
parents 34fbe58d19da
children 182cb8a8d2d8
files mod_srvinjection/mod_srvinjection.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_srvinjection/mod_srvinjection.lua	Fri Dec 06 02:31:47 2013 +0000
+++ b/mod_srvinjection/mod_srvinjection.lua	Tue Dec 10 23:15:15 2013 +0000
@@ -3,9 +3,10 @@
 
 local adns = require "net.adns";
 
-local map = module:get_option("srvinjection") or {};
+local map_config = module:get_option("srvinjection") or {};
+local map = module:shared "s2s_map"
 
-for host, mapping in pairs(map) do
+for host, mapping in pairs(map_config) do
 	if type(mapping) == "table" and type(mapping[1]) == "string" and (type(mapping[2]) == "number") then
 		local connecthost, connectport = mapping[1], mapping[2] or 5269;
 		map[host] = {{