Software /
code /
prosody
Comparison
plugins/mod_s2s/mod_s2s.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 | 4993:5243b74a4cbb |
child | 4997:61083e2b1392 |
comparison
equal
deleted
inserted
replaced
4995:47a7ac6508b3 | 4996:164dc19519d8 |
---|---|
342 session.sends2s("<?xml version='1.0'?>"); | 342 session.sends2s("<?xml version='1.0'?>"); |
343 session.sends2s(st.stanza("stream:stream", default_stream_attr):top_tag()); | 343 session.sends2s(st.stanza("stream:stream", default_stream_attr):top_tag()); |
344 end | 344 end |
345 if reason then -- nil == no err, initiated by us, false == initiated by remote | 345 if reason then -- nil == no err, initiated by us, false == initiated by remote |
346 if type(reason) == "string" then -- assume stream error | 346 if type(reason) == "string" then -- assume stream error |
347 log("info", "Disconnecting %s[%s], <stream:error> is: %s", session.host or "(unknown host)", session.type, reason); | 347 log("debug", "Disconnecting %s[%s], <stream:error> is: %s", session.host or "(unknown host)", session.type, reason); |
348 session.sends2s(st.stanza("stream:error"):tag(reason, {xmlns = 'urn:ietf:params:xml:ns:xmpp-streams' })); | 348 session.sends2s(st.stanza("stream:error"):tag(reason, {xmlns = 'urn:ietf:params:xml:ns:xmpp-streams' })); |
349 elseif type(reason) == "table" then | 349 elseif type(reason) == "table" then |
350 if reason.condition then | 350 if reason.condition then |
351 local stanza = st.stanza("stream:error"):tag(reason.condition, stream_xmlns_attr):up(); | 351 local stanza = st.stanza("stream:error"):tag(reason.condition, stream_xmlns_attr):up(); |
352 if reason.text then | 352 if reason.text then |
353 stanza:tag("text", stream_xmlns_attr):text(reason.text):up(); | 353 stanza:tag("text", stream_xmlns_attr):text(reason.text):up(); |
354 end | 354 end |
355 if reason.extra then | 355 if reason.extra then |
356 stanza:add_child(reason.extra); | 356 stanza:add_child(reason.extra); |
357 end | 357 end |
358 log("info", "Disconnecting %s[%s], <stream:error> is: %s", session.host or "(unknown host)", session.type, tostring(stanza)); | 358 log("debug", "Disconnecting %s[%s], <stream:error> is: %s", session.host or "(unknown host)", session.type, tostring(stanza)); |
359 session.sends2s(stanza); | 359 session.sends2s(stanza); |
360 elseif reason.name then -- a stanza | 360 elseif reason.name then -- a stanza |
361 log("info", "Disconnecting %s->%s[%s], <stream:error> is: %s", session.from_host or "(unknown host)", session.to_host or "(unknown host)", session.type, tostring(reason)); | 361 log("debug", "Disconnecting %s->%s[%s], <stream:error> is: %s", session.from_host or "(unknown host)", session.to_host or "(unknown host)", session.type, tostring(reason)); |
362 session.sends2s(reason); | 362 session.sends2s(reason); |
363 end | 363 end |
364 end | 364 end |
365 end | 365 end |
366 | 366 |