Merge timber->trunk - thanks everyone!
[prosody.git] / plugins / mod_bosh.lua
index 20a6fa1f5b8f4fa4b956c0fe83ba1acb3ebc8db5..c5576004ecf497890ec9a73f6a2d9c354bbc2820 100644 (file)
@@ -123,10 +123,10 @@ function handle_request(method, body, request)
        
        -- stream:feed() calls the stream_callbacks, so all stanzas in
        -- the body are processed in this next line before it returns.
-       -- In particular, the streamopened() stream callback is where
-       -- much of the session logic happens, because it's where we first
-       -- get to see the 'sid' of this request.
-       stream:feed(body);
+       local ok, err = stream:feed(body);
+       if not ok then
+               log("error", "Failed to parse BOSH payload: %s", err);
+       end
        
        -- Stanzas (if any) in the request have now been processed, and
        -- we take care of the high-level BOSH logic here, including