# HG changeset patch # User Matthew Wild # Date 1291747102 0 # Node ID 79f62694d36e7c9d398736f9910387cf1ea558b8 # Parent b758e4ad30a0b489dad13e8688950f4b9f90c067 mod_bosh: Switch to util.xmppstream from xmlhandlers diff -r b758e4ad30a0 -r 79f62694d36e plugins/mod_bosh.lua --- a/plugins/mod_bosh.lua Tue Dec 07 18:18:11 2010 +0000 +++ b/plugins/mod_bosh.lua Tue Dec 07 18:38:22 2010 +0000 @@ -10,7 +10,7 @@ local hosts = _G.hosts; local lxp = require "lxp"; -local init_xmlhandlers = require "core.xmlhandlers" +local new_xmpp_stream = require "util.xmppstream".new; local httpserver = require "net.httpserver"; local sm = require "core.sessionmanager"; local sm_destroy_session = sm.destroy_session; @@ -119,9 +119,10 @@ request.log = log; request.on_destroy = on_destroy_request; - local parser = lxp.new(init_xmlhandlers(request, stream_callbacks), "\1"); - - parser:parse(body); + local stream = new_xmpp_stream(request, stream_callbacks); + -- stream:feed() calls the stream_callbacks, so all stanzas in + -- the body are processed in this next line before it returns. + stream:feed(body); local session = sessions[request.sid]; if session then