Comparison

mod_proxy65/mod_proxy65.lua @ 73:adb9d1b879c2

mod_proxy65: changed the listener name to be unique on a per component basis and display a good error description when connlistener register fails
author Thilo Cestonaro <thilo@cestona.ro>
date Sat, 31 Oct 2009 20:53:52 +0100
parent 72:2bf6c7c590a1
child 74:d70813f7d90a
comparison
equal deleted inserted replaced
72:2bf6c7c590a1 73:adb9d1b879c2
5 -- 5 --
6 6
7 if module:get_host_type() ~= "component" then 7 if module:get_host_type() ~= "component" then
8 error("proxy65 should be loaded as a component, please see http://prosody.im/doc/components", 0); 8 error("proxy65 should be loaded as a component, please see http://prosody.im/doc/components", 0);
9 end 9 end
10
11 10
12 local jid_split = require "util.jid".split; 11 local jid_split = require "util.jid".split;
13 local st = require "util.stanza"; 12 local st = require "util.stanza";
14 local componentmanager = require "core.componentmanager"; 13 local componentmanager = require "core.componentmanager";
15 local config_get = require "core.configmanager".get; 14 local config_get = require "core.configmanager".get;
189 end 188 end
190 end 189 end
191 return; 190 return;
192 end 191 end
193 192
194 if not connlisteners.register('proxy65', connlistener) then 193 if not connlisteners.register(module.host .. ':proxy65', connlistener) then
195 error("mod_proxy65: Could not establish a connection listener. Check your configuration please."); 194 error("mod_proxy65: Could not establish a connection listener. Check your configuration please.");
195 error(" one possible cause for this would be that two proxy65 components share the same port.");
196 end 196 end
197 197
198 connlisteners.start('proxy65'); 198 connlisteners.start('proxy65');
199 component = componentmanager.register_component(host, handle_to_domain); 199 component = componentmanager.register_component(host, handle_to_domain);