mod_smacks: Check if a session is an authenticated c2s session by looking for a username (fix for change in 0.10 9f70d35a1602)
authorKim Alvefur <zash@zash.se>
Thu, 15 Dec 2016 02:57:03 +0100
changeset 2421 5e7badecf7fe
parent 2420 ade918cd9ca7
child 2422 ef95853cf900
mod_smacks: Check if a session is an authenticated c2s session by looking for a username (fix for change in 0.10 9f70d35a1602)
mod_smacks/mod_smacks.lua
--- a/mod_smacks/mod_smacks.lua	Tue Dec 13 22:08:02 2016 +0100
+++ b/mod_smacks/mod_smacks.lua	Thu Dec 15 02:57:03 2016 +0100
@@ -53,7 +53,7 @@
 	if session.smacks then return false, "unexpected-request", "Stream management is already enabled"; end
 
 	local session_type = session.type;
-	if session_type == "c2s" then
+	if session.username then
 		if not(advertise_only) and not(session.resource) then -- Fail unless we're only advertising sm
 			return false, "unexpected-request", "Client must bind a resource before enabling stream management";
 		end