From d0072c9cfab3365c0fe5f8f3bfda87be899c8e13 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 26 Feb 2009 02:24:12 +0000 Subject: net/xmppclient_listener: Add some logging and handle unestablished sessions error'ing --- net/xmppclient_listener.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/xmppclient_listener.lua b/net/xmppclient_listener.lua index ad1fd948..e7a87c1e 100644 --- a/net/xmppclient_listener.lua +++ b/net/xmppclient_listener.lua @@ -29,9 +29,10 @@ local stream_callbacks = { stream_tag = "http://etherx.jabber.org/streams|stream function stream_callbacks.error(session, error, data) if error == "no-stream" then + session.log("debug", "Invalid opening stream header"); session:close("invalid-namespace"); - else - session.log("debug", "Client XML parse error: %s", tostring(error)); + elseif session.close then + (session.log or log)("debug", "Client XML parse error: %s", tostring(error)); session:close("xml-not-well-formed"); end end -- cgit v1.2.3