# HG changeset patch # User Matthew Wild # Date 1254663339 -3600 # Node ID d5dc9e06d91795c783c7dc4ce8beacebaef136e3 # Parent 42157c0668132836f32b574b8305505cd95244d5 xmppserver_listener: Add status() function to signal when a connection completes its SSL handshake diff -r 42157c066813 -r d5dc9e06d917 net/xmppserver_listener.lua --- a/net/xmppserver_listener.lua Sun Oct 04 14:24:55 2009 +0100 +++ b/net/xmppserver_listener.lua Sun Oct 04 14:35:39 2009 +0100 @@ -134,6 +134,17 @@ end end +function xmppserver.status(conn, status) + if status == "ssl-handshake-complete" then + local session = sessions[conn]; + if session and session.direction == "outgoing" then + local format, to_host, from_host = string.format, session.to_host, session.from_host; + session.log("warn", "Sending stream header..."); + session.sends2s(format([[]], from_host, to_host)); + end + end +end + function xmppserver.disconnect(conn, err) local session = sessions[conn]; if session then