Software / code / prosody
Comparison
plugins/mod_admin_shell.lua @ 12126:0d8e6646ce42
mod_admin_shell: Log creation of incoming s2s connections during ping
The 's2s-created' fires just after accepting the TCP connection, before
the addresses are known, so this can have some false positives.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 27 Dec 2021 17:04:33 +0100 |
| parent | 12122:50795249b7be |
| child | 12208:3edf1a38fb15 |
comparison
equal
deleted
inserted
replaced
| 12125:649268c9f603 | 12126:0d8e6646ce42 |
|---|---|
| 1394 if (s2s_session.from_host == localhost and s2s_session.to_host == remotehost) | 1394 if (s2s_session.from_host == localhost and s2s_session.to_host == remotehost) |
| 1395 or (s2s_session.to_host == localhost and s2s_session.from_host == remotehost) then | 1395 or (s2s_session.to_host == localhost and s2s_session.from_host == remotehost) then |
| 1396 local dir = available_columns.dir.mapper(s2s_session.direction, s2s_session); | 1396 local dir = available_columns.dir.mapper(s2s_session.direction, s2s_session); |
| 1397 print(("Session %s (%s%s%s) %s (%gs)"):format(s2s_session.id, localhost, dir, remotehost, what, | 1397 print(("Session %s (%s%s%s) %s (%gs)"):format(s2s_session.id, localhost, dir, remotehost, what, |
| 1398 time.now() - time_start)); | 1398 time.now() - time_start)); |
| 1399 elseif s2s_session.type == "s2sin_unauthed" and s2s_session.to_host == nil and s2s_session.from_host == nil then | |
| 1400 print(("Session %s %s (%gs)"):format(s2s_session.id, what, time.now() - time_start)); | |
| 1399 end | 1401 end |
| 1400 end | 1402 end |
| 1401 end | 1403 end |
| 1402 local oncreated = onchange("created"); | 1404 local oncreated = onchange("created"); |
| 1403 local onauthenticated = onchange("authenticated"); | 1405 local onauthenticated = onchange("authenticated"); |