Mercurial > prosody-hg
comparison core/xmlhandlers.lua @ 7:dcc5ac721c20
- Remove some debugging code
- Don't allow stanzas to be sent before successful auth (needs further review)
- Make init_xmlhandlers local
- Fix indentation in main.lua
- Fix disconnect logic (it broke if client disconnected before auth, etc.)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 24 Aug 2008 22:48:27 +0100 |
| parents | b8787e859fd2 |
| children | 6885fd2cf51f |
comparison
equal
deleted
inserted
replaced
| 6:7ad47ce20394 | 7:dcc5ac721c20 |
|---|---|
| 40 session.host = attr.to or error("Client failed to specify destination hostname"); | 40 session.host = attr.to or error("Client failed to specify destination hostname"); |
| 41 session.version = attr.version or 0; | 41 session.version = attr.version or 0; |
| 42 session.streamid = m_random(1000000, 99999999); | 42 session.streamid = m_random(1000000, 99999999); |
| 43 print(session, session.host, "Client opened stream"); | 43 print(session, session.host, "Client opened stream"); |
| 44 send("<?xml version='1.0'?>"); | 44 send("<?xml version='1.0'?>"); |
| 45 send(format("<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='%s' from='%s' >", session.streamid, session.host)); | 45 send(format("<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='%s' from='%s' version='1.0'>", session.streamid, session.host)); |
| 46 --send("<stream:features>"); | 46 --send("<stream:features>"); |
| 47 --send("<mechanism>PLAIN</mechanism>"); | 47 --send("<mechanism>PLAIN</mechanism>"); |
| 48 --send [[<register xmlns="http://jabber.org/features/iq-register"/> ]] | 48 --send [[<register xmlns="http://jabber.org/features/iq-register"/> ]] |
| 49 --send("</stream:features>"); | 49 --send("</stream:features>"); |
| 50 log("info", "core", "Stream opened successfully"); | 50 log("info", "core", "Stream opened successfully"); |
