mod_bosh: Log error on BOSH parse failure (thanks daurnimator)
authorMatthew Wild <mwild1@gmail.com>
Thu, 19 Apr 2012 19:30:47 +0100
changeset 4526 cdab466551bd
parent 4517 2e274e088ddc
child 4527 d00f31470fcf
child 4793 eaa8991998d5
mod_bosh: Log error on BOSH parse failure (thanks daurnimator)
plugins/mod_bosh.lua
--- a/plugins/mod_bosh.lua	Mon Mar 05 22:11:29 2012 +0100
+++ b/plugins/mod_bosh.lua	Thu Apr 19 19:30:47 2012 +0100
@@ -121,7 +121,10 @@
 	local stream = new_xmpp_stream(request, stream_callbacks);
 	-- stream:feed() calls the stream_callbacks, so all stanzas in
 	-- the body are processed in this next line before it returns.
-	stream:feed(body);
+	local ok, err = stream:feed(body);
+	if not ok then
+		log("error", "Failed to parse BOSH payload: %s", err);
+	end
 	
 	local session = sessions[request.sid];
 	if session then