equal
deleted
inserted
replaced
28 local st = require "util.stanza"; |
28 local st = require "util.stanza"; |
29 |
29 |
30 local config = require "core.configmanager"; |
30 local config = require "core.configmanager"; |
31 local opt_keepalives = config.get("*", "core", "tcp_keepalives"); |
31 local opt_keepalives = config.get("*", "core", "tcp_keepalives"); |
32 |
32 |
33 local stream_callbacks = { stream_tag = "http://etherx.jabber.org/streams\1stream", |
33 local stream_callbacks = { default_ns = "jabber:client", |
34 default_ns = "jabber:client", |
|
35 streamopened = sm_streamopened, streamclosed = sm_streamclosed, handlestanza = core_process_stanza }; |
34 streamopened = sm_streamopened, streamclosed = sm_streamclosed, handlestanza = core_process_stanza }; |
36 |
35 |
37 function stream_callbacks.error(session, error, data) |
36 function stream_callbacks.error(session, error, data) |
38 if error == "no-stream" then |
37 if error == "no-stream" then |
39 session.log("debug", "Invalid opening stream header"); |
38 session.log("debug", "Invalid opening stream header"); |
69 end |
68 end |
70 |
69 |
71 return true; |
70 return true; |
72 end |
71 end |
73 |
72 |
74 |
|
75 local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'}; |
73 local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'}; |
76 local default_stream_attr = { ["xmlns:stream"] = stream_callbacks.stream_tag:match("[^\1]*"), xmlns = stream_callbacks.default_ns, version = "1.0", id = "" }; |
74 local default_stream_attr = { ["xmlns:stream"] = "http://etherx.jabber.org/streams", xmlns = stream_callbacks.default_ns, version = "1.0", id = "" }; |
77 local function session_close(session, reason) |
75 local function session_close(session, reason) |
78 local log = session.log or log; |
76 local log = session.log or log; |
79 if session.conn then |
77 if session.conn then |
80 if session.notopen then |
78 if session.notopen then |
81 session.send("<?xml version='1.0'?>"); |
79 session.send("<?xml version='1.0'?>"); |