Changeset

8185:e89320b8a789

Merge 0.10 -> trunk
author Matthew Wild <mwild1@gmail.com>
date Fri, 28 Jul 2017 23:47:38 +0100
parents 8181:79f73af4c410 (current diff) 8184:dbcae15b4282 (diff)
children 8201:a0ad62a269df
files core/sessionmanager.lua plugins/mod_bosh.lua
diffstat 3 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/core/sessionmanager.lua	Thu Jul 06 11:24:36 2017 +0200
+++ b/core/sessionmanager.lua	Fri Jul 28 23:47:38 2017 +0100
@@ -188,10 +188,14 @@
 	local err;
 	session.roster, err = rm_load_roster(session.username, session.host);
 	if err then
+		-- FIXME: Why is all this rollback down here, instead of just doing the roster test up above?
 		full_sessions[session.full_jid] = nil;
 		hosts[session.host].sessions[session.username].sessions[resource] = nil;
 		session.full_jid = nil;
 		session.resource = nil;
+		if session.type == "c2s" then
+			session.type = "c2s_unbound";
+		end
 		if next(bare_sessions[session.username..'@'..session.host].sessions) == nil then
 			bare_sessions[session.username..'@'..session.host] = nil;
 			hosts[session.host].sessions[session.username] = nil;
--- a/plugins/mod_bosh.lua	Thu Jul 06 11:24:36 2017 +0200
+++ b/plugins/mod_bosh.lua	Fri Jul 28 23:47:38 2017 +0100
@@ -49,7 +49,7 @@
 if cross_domain == true then cross_domain = "*"; end
 if type(cross_domain) == "table" then cross_domain = table.concat(cross_domain, ", "); end
 
-local trusted_proxies = module:get_option_set("trusted_proxies", {"127.0.0.1"})._items;
+local trusted_proxies = module:get_option_set("trusted_proxies", { "127.0.0.1", "::1" })._items;
 
 local function get_ip_from_request(request)
 	local ip = request.conn:ip();
--- a/plugins/mod_register.lua	Thu Jul 06 11:24:36 2017 +0200
+++ b/plugins/mod_register.lua	Fri Jul 28 23:47:38 2017 +0100
@@ -182,7 +182,7 @@
 
 local min_seconds_between_registrations = module:get_option_number("min_seconds_between_registrations");
 local whitelist_only = module:get_option_boolean("whitelist_registration_only");
-local whitelisted_ips = module:get_option_set("registration_whitelist", { "127.0.0.1" })._items;
+local whitelisted_ips = module:get_option_set("registration_whitelist", { "127.0.0.1", "::1" })._items;
 local blacklisted_ips = module:get_option_set("registration_blacklist", {})._items;
 
 local throttle_max = module:get_option_number("registration_throttle_max", min_seconds_between_registrations and 1);