hostmanager: Don't include hosts with '@' or '/' in the name in the get_children(host) result.

Wed, 10 Nov 2010 20:36:37 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Wed, 10 Nov 2010 20:36:37 +0500
changeset 3601
829e23b374cc
parent 3600
c888328ae6b3
child 3602
a977d8be6277

hostmanager: Don't include hosts with '@' or '/' in the name in the get_children(host) result.

core/hostmanager.lua file | annotate | diff | comparison | revisions
--- a/core/hostmanager.lua	Wed Nov 10 20:31:28 2010 +0500
+++ b/core/hostmanager.lua	Wed Nov 10 20:36:37 2010 +0500
@@ -71,7 +71,9 @@
 		host_session.type = "component";
 	end
 	hosts[host] = host_session;
-	disco_items:set(host:match("%.(.*)") or "*", host, true);
+	if not host:match("[@/]") then
+		disco_items:set(host:match("%.(.*)") or "*", host, true);
+	end
 	for option_name in pairs(host_config.core) do
 		if option_name:match("_ports$") or option_name:match("_interface$") then
 			log("warn", "%s: Option '%s' has no effect for virtual hosts - put it in the server-wide section instead", host, option_name);
@@ -122,7 +124,9 @@
 	end
 
 	hosts[host] = nil;
-	disco_items:remove(host:match("%.(.*)") or "*", host);
+	if not host:match("[@/]") then
+		disco_items:remove(host:match("%.(.*)") or "*", host);
+	end
 	prosody_events.fire_event("host-deactivated", host);
 	log("info", "Deactivated host: %s", host);
 end

mercurial