Comparison

plugins/mod_bosh.lua @ 4527:d00f31470fcf

Merge with 0.9
author Matthew Wild <mwild1@gmail.com>
date Thu, 19 Apr 2012 19:35:10 +0100
parent 4457:332a5d73e5b6
parent 4526:cdab466551bd
child 4684:dc70c4ffb66d
comparison
equal deleted inserted replaced
4525:e00b4ec5fca4 4527:d00f31470fcf
121 121
122 local stream = new_xmpp_stream(request, stream_callbacks); 122 local stream = new_xmpp_stream(request, stream_callbacks);
123 123
124 -- stream:feed() calls the stream_callbacks, so all stanzas in 124 -- stream:feed() calls the stream_callbacks, so all stanzas in
125 -- the body are processed in this next line before it returns. 125 -- the body are processed in this next line before it returns.
126 -- In particular, the streamopened() stream callback is where 126 local ok, err = stream:feed(body);
127 -- much of the session logic happens, because it's where we first 127 if not ok then
128 -- get to see the 'sid' of this request. 128 log("error", "Failed to parse BOSH payload: %s", err);
129 stream:feed(body); 129 end
130 130
131 -- Stanzas (if any) in the request have now been processed, and 131 -- Stanzas (if any) in the request have now been processed, and
132 -- we take care of the high-level BOSH logic here, including 132 -- we take care of the high-level BOSH logic here, including
133 -- giving a response or putting the request "on hold". 133 -- giving a response or putting the request "on hold".
134 local session = sessions[request.sid]; 134 local session = sessions[request.sid];