mod_bosh: Log error returned from stream:feed()
authorKim Alvefur <zash@zash.se>
Tue, 19 Apr 2016 10:15:20 +0000 (12:15 +0200)
committerKim Alvefur <zash@zash.se>
Tue, 19 Apr 2016 10:15:20 +0000 (12:15 +0200)
plugins/mod_bosh.lua

index ce51ccc576b9cd96f2ad0b0961f7ebbf7c1cc429..845df61a5639e85de9a65995f0d6509f33cade7e 100644 (file)
@@ -126,8 +126,9 @@ function handle_POST(event)
        -- 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.
-       if not stream:feed(body) then
-               module:log("warn", "Error parsing BOSH payload")
+       local ok, err = stream:feed(body);
+       if not ok then
+               module:log("warn", "Error parsing BOSH payload; %s", err)
                return 400;
        end