58 session_reset_stream(session); -- Initialise, ready for use |
58 session_reset_stream(session); -- Initialise, ready for use |
59 |
59 |
60 -- TODO: Below function should be session,stanza - and xmlhandlers should use :method() notation to call, |
60 -- TODO: Below function should be session,stanza - and xmlhandlers should use :method() notation to call, |
61 -- this will avoid the useless indirection we have atm |
61 -- this will avoid the useless indirection we have atm |
62 -- (I'm on a mission, no time to fix now) |
62 -- (I'm on a mission, no time to fix now) |
63 session.stanza_dispatch = function (stanza) return core_process_stanza(session, stanza); end |
63 |
|
64 -- Debug version -- |
|
65 local function handleerr() print("Traceback:", debug.traceback()); end |
|
66 session.stanza_dispatch = function (stanza) return select(2, xpcall(function () return core_process_stanza(session, stanza); end, handleerr)); end |
|
67 |
|
68 -- session.stanza_dispatch = function (stanza) return core_process_stanza(session, stanza); end |
64 |
69 |
65 end |
70 end |
66 if data then |
71 if data then |
67 session.data(conn, data); |
72 session.data(conn, data); |
68 end |
73 end |