trunk

changeset 4805:1aeece2cc814

mod_component: Components start out as component_unauthed until successful authentication (thanks xnyhps)
author Matthew Wild <mwild1@gmail.com>
date Mon, 30 Apr 2012 01:02:39 +0100
parents 607414b26c8c
children 27a99c289b90
files plugins/mod_component.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/plugins/mod_component.lua	Mon Apr 30 00:52:43 2012 +0100
     1.2 +++ b/plugins/mod_component.lua	Mon Apr 30 01:02:39 2012 +0100
     1.3 @@ -76,6 +76,7 @@
     1.4  		send = session.send;
     1.5  		session.on_destroy = on_destroy;
     1.6  		session.component_validate_from = module:get_option_boolean("validate_from_addresses", true);
     1.7 +		session.type = "component";
     1.8  		module:log("info", "External component successfully authenticated");
     1.9  		session.send(st.stanza("handshake"));
    1.10  	
    1.11 @@ -244,7 +245,7 @@
    1.12  
    1.13  function listener.onconnect(conn)
    1.14  	local _send = conn.write;
    1.15 -	local session = { type = "component", conn = conn, send = function (data) return _send(conn, tostring(data)); end };
    1.16 +	local session = { type = "component_unauthed", conn = conn, send = function (data) return _send(conn, tostring(data)); end };
    1.17  
    1.18  	-- Logging functions --
    1.19  	local conn_name = "jcp"..tostring(conn):match("[a-f0-9]+$");