Comparison

plugins/mod_c2s.lua @ 4996:164dc19519d8

mod_c2s, mod_s2s: Lower 'Disconnecting X' log messages from 'info' to 'debug'
author Matthew Wild <mwild1@gmail.com>
date Mon, 23 Jul 2012 18:28:14 +0100
parent 4986:9da430b69f13
child 5013:ab693eea0869
comparison
equal deleted inserted replaced
4995:47a7ac6508b3 4996:164dc19519d8
122 session.send("<?xml version='1.0'?>"); 122 session.send("<?xml version='1.0'?>");
123 session.send(st.stanza("stream:stream", default_stream_attr):top_tag()); 123 session.send(st.stanza("stream:stream", default_stream_attr):top_tag());
124 end 124 end
125 if reason then -- nil == no err, initiated by us, false == initiated by client 125 if reason then -- nil == no err, initiated by us, false == initiated by client
126 if type(reason) == "string" then -- assume stream error 126 if type(reason) == "string" then -- assume stream error
127 log("info", "Disconnecting client, <stream:error> is: %s", reason); 127 log("debug", "Disconnecting client, <stream:error> is: %s", reason);
128 session.send(st.stanza("stream:error"):tag(reason, {xmlns = 'urn:ietf:params:xml:ns:xmpp-streams' })); 128 session.send(st.stanza("stream:error"):tag(reason, {xmlns = 'urn:ietf:params:xml:ns:xmpp-streams' }));
129 elseif type(reason) == "table" then 129 elseif type(reason) == "table" then
130 if reason.condition then 130 if reason.condition then
131 local stanza = st.stanza("stream:error"):tag(reason.condition, stream_xmlns_attr):up(); 131 local stanza = st.stanza("stream:error"):tag(reason.condition, stream_xmlns_attr):up();
132 if reason.text then 132 if reason.text then
133 stanza:tag("text", stream_xmlns_attr):text(reason.text):up(); 133 stanza:tag("text", stream_xmlns_attr):text(reason.text):up();
134 end 134 end
135 if reason.extra then 135 if reason.extra then
136 stanza:add_child(reason.extra); 136 stanza:add_child(reason.extra);
137 end 137 end
138 log("info", "Disconnecting client, <stream:error> is: %s", tostring(stanza)); 138 log("debug", "Disconnecting client, <stream:error> is: %s", tostring(stanza));
139 session.send(stanza); 139 session.send(stanza);
140 elseif reason.name then -- a stanza 140 elseif reason.name then -- a stanza
141 log("info", "Disconnecting client, <stream:error> is: %s", tostring(reason)); 141 log("debug", "Disconnecting client, <stream:error> is: %s", tostring(reason));
142 session.send(reason); 142 session.send(reason);
143 end 143 end
144 end 144 end
145 end 145 end
146 146