Changeset

837:86d14e7ef60c

net/xmppclient_listener: Add some logging and handle unestablished sessions error'ing
author Matthew Wild <mwild1@gmail.com>
date Thu, 26 Feb 2009 02:24:12 +0000
parents 836:073386be5ccc
children 838:1035846d6273
files net/xmppclient_listener.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/net/xmppclient_listener.lua	Mon Feb 23 01:14:23 2009 +0500
+++ b/net/xmppclient_listener.lua	Thu Feb 26 02:24:12 2009 +0000
@@ -29,9 +29,10 @@
 
 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