Merge 0.9->0.10
[prosody.git] / plugins / mod_c2s.lua
index bb3858c0770604f527249c40a935daa0733c3a33..4238b2e7e1f3b729450dcccd845477f9065ff62e 100644 (file)
@@ -240,9 +240,9 @@ function listener.onconnect(conn)
        function session.data(data)
                -- Parse the data, which will store stanzas in session.pending_stanzas
                if data then
-                       data = filter("bytes/in", data);
-                       if data then
-                               local ok, err = stream:feed(data);
+               data = filter("bytes/in", data);
+               if data then
+                       local ok, err = stream:feed(data);
                                if not ok then
                                        log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_"));
                                        session:close("not-well-formed");