From 23a72948e91293a59e6c34a14b22e5d00f46d767 Mon Sep 17 00:00:00 2001
From: Waqas Hussain <waqas20@gmail.com>
Date: Mon, 17 Feb 2014 16:00:41 -0500
Subject: mod_auth_anonymous: Fixed a traceback in listing all users
 (issue#396).

---
 plugins/mod_auth_anonymous.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/mod_auth_anonymous.lua b/plugins/mod_auth_anonymous.lua
index c877d532..8de46f8c 100644
--- a/plugins/mod_auth_anonymous.lua
+++ b/plugins/mod_auth_anonymous.lua
@@ -43,7 +43,7 @@ function provider.get_sasl_handler()
 end
 
 function provider.users()
-	return next, hosts[host].sessions, nil;
+	return next, hosts[module.host].sessions, nil;
 end
 
 -- datamanager callback to disable writes
-- 
cgit v1.2.3


From 9b804fffc8bc1f5e2e50ebcfebe227a6de56ee63 Mon Sep 17 00:00:00 2001
From: Waqas Hussain <waqas20@gmail.com>
Date: Tue, 18 Feb 2014 16:03:13 -0500
Subject: tools/ejabberd2prosody: Don't throw an error if XML CDATA is null ([]
 in Erlang, instead of a string or being missing).

---
 tools/ejabberd2prosody.lua | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/ejabberd2prosody.lua b/tools/ejabberd2prosody.lua
index be1504b2..d0675a65 100755
--- a/tools/ejabberd2prosody.lua
+++ b/tools/ejabberd2prosody.lua
@@ -44,8 +44,10 @@ function build_stanza(tuple, stanza)
 		for _, a in ipairs(tuple[4]) do build_stanza(a, stanza); end
 		if up then stanza:up(); else return stanza end
 	elseif tuple[1] == "xmlcdata" then
-		assert(type(tuple[2]) == "string", "XML CDATA has unexpected type: "..type(tuple[2]));
-		stanza:text(tuple[2]);
+		if type(tuple[2]) ~= "table" then
+			assert(type(tuple[2]) == "string", "XML CDATA has unexpected type: "..type(tuple[2]));
+			stanza:text(tuple[2]);
+		end -- else it's [], i.e., the null value, used for the empty string
 	else
 		error("unknown element type: "..serialize(tuple));
 	end
-- 
cgit v1.2.3


From c9cc08e80dc8019c93112e9b65fff90ac3f72e49 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Thu, 20 Feb 2014 19:08:55 +0100
Subject: mod_http: Use hostname from the correct context (thanks gryffus)

---
 plugins/mod_http.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua
index 0689634e..afcec069 100644
--- a/plugins/mod_http.lua
+++ b/plugins/mod_http.lua
@@ -42,7 +42,7 @@ local function get_base_path(host_module, app_name, default_app_path)
 	return (normalize_path(host_module:get_option("http_paths", {})[app_name] -- Host
 		or module:get_option("http_paths", {})[app_name] -- Global
 		or default_app_path)) -- Default
-		:gsub("%$(%w+)", { host = module.host });
+		:gsub("%$(%w+)", { host = host_module.host });
 end
 
 local ports_by_scheme = { http = 80, https = 443, };
-- 
cgit v1.2.3


From 4ee0ced8eb75a28f30744f18694ca1fab670bea0 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Wed, 26 Feb 2014 22:19:58 +0100
Subject: mod_http: Fix http_external_url setting without an explicit port

---
 plugins/mod_http.lua | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua
index afcec069..86689aff 100644
--- a/plugins/mod_http.lua
+++ b/plugins/mod_http.lua
@@ -51,6 +51,9 @@ local ports_by_scheme = { http = 80, https = 443, };
 function moduleapi.http_url(module, app_name, default_path)
 	app_name = app_name or (module.name:gsub("^http_", ""));
 	local external_url = url_parse(module:get_option_string("http_external_url")) or {};
+	if external_url.scheme and external_url.port == nil then
+		external_url.port = ports_by_scheme[external_url.scheme];
+	end
 	local services = portmanager.get_active_services();
 	local http_services = services:get("https") or services:get("http") or {};
 	for interface, ports in pairs(http_services) do
-- 
cgit v1.2.3