Software / code / prosody
Comparison
core/sessionmanager.lua @ 30:bcf539295f2d
Huge commit to:
* Break stanza routing (to be restored in a future commit)
* Remove the old stanza_dispatcher code, which was never going to be maintainable nor extendable :)
* Bring us plugins, starting with mod_legacyauth and mod_roster
* Sessions are now created/destroyed using a standard sessionmanager interface
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 30 Sep 2008 19:52:00 +0100 |
| child | 38:3fdfd6e0cb4e |
comparison
equal
deleted
inserted
replaced
| 29:b847875801e5 | 30:bcf539295f2d |
|---|---|
| 1 | |
| 2 local tostring = tostring; | |
| 3 | |
| 4 local log = require "util.logger".init("sessionmanager"); | |
| 5 | |
| 6 module "sessionmanager" | |
| 7 | |
| 8 function new_session(conn) | |
| 9 local session = { conn = conn, notopen = true, priority = 0, type = "c2s_unauthed" }; | |
| 10 local w = conn.write; | |
| 11 session.send = function (t) w(tostring(t)); end | |
| 12 return session; | |
| 13 end | |
| 14 | |
| 15 function send_to_session(session, data) | |
| 16 log("debug", "Sending...", tostring(data)); | |
| 17 session.conn.write(tostring(data)); | |
| 18 end | |
| 19 | |
| 20 return _M; |