Comparison

core/hostmanager.lua @ 3601:829e23b374cc

hostmanager: Don't include hosts with '@' or '/' in the name in the get_children(host) result.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 10 Nov 2010 20:36:37 +0500
parent 3599:adc0b4df6fdd
child 3715:d7574530572c
comparison
equal deleted inserted replaced
3600:c888328ae6b3 3601:829e23b374cc
69 end 69 end
70 else -- component 70 else -- component
71 host_session.type = "component"; 71 host_session.type = "component";
72 end 72 end
73 hosts[host] = host_session; 73 hosts[host] = host_session;
74 disco_items:set(host:match("%.(.*)") or "*", host, true); 74 if not host:match("[@/]") then
75 disco_items:set(host:match("%.(.*)") or "*", host, true);
76 end
75 for option_name in pairs(host_config.core) do 77 for option_name in pairs(host_config.core) do
76 if option_name:match("_ports$") or option_name:match("_interface$") then 78 if option_name:match("_ports$") or option_name:match("_interface$") then
77 log("warn", "%s: Option '%s' has no effect for virtual hosts - put it in the server-wide section instead", host, option_name); 79 log("warn", "%s: Option '%s' has no effect for virtual hosts - put it in the server-wide section instead", host, option_name);
78 end 80 end
79 end 81 end
120 modulemanager.unload(host, module); 122 modulemanager.unload(host, module);
121 end 123 end
122 end 124 end
123 125
124 hosts[host] = nil; 126 hosts[host] = nil;
125 disco_items:remove(host:match("%.(.*)") or "*", host); 127 if not host:match("[@/]") then
128 disco_items:remove(host:match("%.(.*)") or "*", host);
129 end
126 prosody_events.fire_event("host-deactivated", host); 130 prosody_events.fire_event("host-deactivated", host);
127 log("info", "Deactivated host: %s", host); 131 log("info", "Deactivated host: %s", host);
128 end 132 end
129 133
130 function get_children(host) 134 function get_children(host)