Comparison

plugins/mod_component.lua @ 3579:9720fa5e0991

mod_component: Send back a <conflict/> stream error when multiple sessions attempt to bind.
author Waqas Hussain <waqas20@gmail.com>
date Tue, 09 Nov 2010 20:23:28 +0500
parent 3540:bc139431830b
child 3581:3f3f8227ba76
comparison
equal deleted inserted replaced
3578:410d2df8a824 3579:9720fa5e0991
67 end); 67 end);
68 hosts[session.host].connected = true; 68 hosts[session.host].connected = true;
69 log("info", "Component successfully registered"); 69 log("info", "Component successfully registered");
70 else 70 else
71 log("error", "Multiple components bound to the same address, first one wins (TODO: Implement stanza distribution)"); 71 log("error", "Multiple components bound to the same address, first one wins (TODO: Implement stanza distribution)");
72 session:close{ condition = "conflict", text = "Component already connected" };
73 return true;
72 end 74 end
73 75
74 -- Signal successful authentication 76 -- Signal successful authentication
75 session.send(st.stanza("handshake")); 77 session.send(st.stanza("handshake"));
76 return true; 78 return true;