mod_compression: More robust stanza processing.

Tue, 09 Mar 2010 18:19:50 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Tue, 09 Mar 2010 18:19:50 +0500
changeset 2885
ae72c0dd6f1f
parent 2884
6807f5fa0eb4
child 2886
3baee526d714

mod_compression: More robust stanza processing.

plugins/mod_compression.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_compression.lua	Tue Mar 09 18:11:45 2010 +0500
+++ b/plugins/mod_compression.lua	Tue Mar 09 18:19:50 2010 +0500
@@ -47,7 +47,8 @@
 			end
 			
 			-- checking if the compression method is supported
-			local method = stanza:child_with_name("method")[1];
+			local method = stanza:child_with_name("method");
+			method = method and method[1];
 			if method == "zlib" then
 				-- create deflate and inflate streams
 				local status, deflate_stream = pcall(zlib.deflate, compression_level);

mercurial