Comparison

plugins/mod_bosh.lua @ 4526:cdab466551bd

mod_bosh: Log error on BOSH parse failure (thanks daurnimator)
author Matthew Wild <mwild1@gmail.com>
date Thu, 19 Apr 2012 19:30:47 +0100
parent 4379:e4d88f4a780c
child 4527:d00f31470fcf
comparison
equal deleted inserted replaced
4517:2e274e088ddc 4526:cdab466551bd
119 request.on_destroy = on_destroy_request; 119 request.on_destroy = on_destroy_request;
120 120
121 local stream = new_xmpp_stream(request, stream_callbacks); 121 local stream = new_xmpp_stream(request, stream_callbacks);
122 -- stream:feed() calls the stream_callbacks, so all stanzas in 122 -- stream:feed() calls the stream_callbacks, so all stanzas in
123 -- the body are processed in this next line before it returns. 123 -- the body are processed in this next line before it returns.
124 stream:feed(body); 124 local ok, err = stream:feed(body);
125 if not ok then
126 log("error", "Failed to parse BOSH payload: %s", err);
127 end
125 128
126 local session = sessions[request.sid]; 129 local session = sessions[request.sid];
127 if session then 130 if session then
128 -- Session was marked as inactive, since we have 131 -- Session was marked as inactive, since we have
129 -- a request open now, unmark it 132 -- a request open now, unmark it