Software / code / prosody-modules
Annotate
mod_pinger/mod_pinger.lua @ 6251:694f8fab07d4
: mod_sasl2*** : Update Compability for all of them
diff --git a/mod_sasl2/README.md b/mod_sasl2/README.md
--- a/mod_sasl2/README.md
+++ b/mod_sasl2/README.md
@@ -31,6 +31,7 @@ This module requires Prosody **trunk** a
Prosody Version Status
----------------------- ----------------
- trunk as of 2024-11-24 Works
+ trunk as of 2025-05-25 Works
+ 0.13 Works
0.12 Does not work
----------------------- ----------------
diff --git a/mod_sasl2_bind2/README.md b/mod_sasl2_bind2/README.md
--- a/mod_sasl2_bind2/README.md
+++ b/mod_sasl2_bind2/README.md
@@ -16,5 +16,6 @@ This module depends on [mod_sasl2]. It e
Prosody-Version Status
--------------- ----------------------
- trunk Works as of 2024-12-21
+ trunk Works as of 2025-05-25
+ 0.13 Works
0.12 Does not work
diff --git a/mod_sasl2_fast/README.md b/mod_sasl2_fast/README.md
--- a/mod_sasl2_fast/README.md
+++ b/mod_sasl2_fast/README.md
@@ -33,5 +33,6 @@ clients being logged out unexpectedly.
Prosody-Version Status
--------------- ----------------------
- trunk Works as of 2024-12-21
+ trunk Works as of 2025-05-25
+ 0.13 Work
0.12 Does not work
diff --git a/mod_sasl2_sm/README.md b/mod_sasl2_sm/README.md
--- a/mod_sasl2_sm/README.md
+++ b/mod_sasl2_sm/README.md
@@ -17,5 +17,6 @@ configuration options.
Prosody-Version Status
--------------- ----------------------
- trunk Works as of 2024-12-21
+ trunk Works as of 2025-05-25
+ 0.13 Work
0.12 Does not work
diff --git a/mod_sasl_ssdp/README.md b/mod_sasl_ssdp/README.md
--- a/mod_sasl_ssdp/README.md
+++ b/mod_sasl_ssdp/README.md
@@ -18,8 +18,8 @@ There are no configuration options for t
# Compatibility
-For SASL2 (XEP-0388) clients, it is compatible with the mod_sasl2 community module.
-
-For clients using RFC 6120 SASL, it requires Prosody trunk 33e5edbd6a4a or
-later. It is not compatible with Prosody 0.12 (it will load, but simply
-won't do anything) for "legacy SASL".
+ Prosody-Version Status
+ --------------- ----------------------
+ trunk Works as of 2025-05-25
+ 0.13 Works
+ 0.12 Does not work
| author | Menel <menel@snikket.de> |
|---|---|
| date | Mon, 12 May 2025 11:07:45 +0200 |
| parent | 3113:8298b06e6603 |
| rev | line source |
|---|---|
| 2034 | 1 local new_watchdog = require "util.watchdog".new; |
| 2 local filters = require "util.filters"; | |
| 3 local st = require "util.stanza"; | |
| 4 | |
| 5 local idle_timeout = module:get_option_number("c2s_idle_timeout", 300); | |
| 6 local ping_timeout = module:get_option_number("c2s_ping_timeout", 30); | |
| 7 | |
| 8 function update_watchdog(data, session) | |
|
3113
8298b06e6603
mod_pinger: work around updates on stale sessions
Georg Lukas <georg@op-co.de>
parents:
3103
diff
changeset
|
9 if session.idle_watchdog then |
|
8298b06e6603
mod_pinger: work around updates on stale sessions
Georg Lukas <georg@op-co.de>
parents:
3103
diff
changeset
|
10 session.idle_watchdog:reset(); |
|
8298b06e6603
mod_pinger: work around updates on stale sessions
Georg Lukas <georg@op-co.de>
parents:
3103
diff
changeset
|
11 session.idle_pinged = nil; |
|
8298b06e6603
mod_pinger: work around updates on stale sessions
Georg Lukas <georg@op-co.de>
parents:
3103
diff
changeset
|
12 end |
| 2034 | 13 return data; |
| 14 end | |
| 15 | |
| 16 function check_session(watchdog) | |
| 17 local session = watchdog.session; | |
|
3103
5bf79bb3cf7e
Neuter 0198 from mod_pinger, fix #712
Georg Lukas <georg@op-co.de>
parents:
2674
diff
changeset
|
18 if session.smacks then |
|
5bf79bb3cf7e
Neuter 0198 from mod_pinger, fix #712
Georg Lukas <georg@op-co.de>
parents:
2674
diff
changeset
|
19 unwatch_session(session); |
|
5bf79bb3cf7e
Neuter 0198 from mod_pinger, fix #712
Georg Lukas <georg@op-co.de>
parents:
2674
diff
changeset
|
20 return; |
|
5bf79bb3cf7e
Neuter 0198 from mod_pinger, fix #712
Georg Lukas <georg@op-co.de>
parents:
2674
diff
changeset
|
21 end |
| 2034 | 22 if not session.idle_pinged then |
| 23 session.idle_pinged = true; | |
|
3103
5bf79bb3cf7e
Neuter 0198 from mod_pinger, fix #712
Georg Lukas <georg@op-co.de>
parents:
2674
diff
changeset
|
24 session.send(st.iq({ type = "get", from = module.host, id = "idle-check" }) |
|
5bf79bb3cf7e
Neuter 0198 from mod_pinger, fix #712
Georg Lukas <georg@op-co.de>
parents:
2674
diff
changeset
|
25 :tag("ping", { xmlns = "urn:xmpp:ping" })); |
| 2034 | 26 return ping_timeout; -- Call us again after ping_timeout |
| 27 else | |
| 28 module:log("info", "Client %q silent for too long, closing...", session.full_jid); | |
| 29 session:close("connection-timeout"); | |
| 30 end | |
| 31 end | |
| 32 | |
| 33 | |
| 34 function watch_session(session) | |
| 35 if not session.idle_watchdog | |
| 36 and not session.requests then -- Don't watch BOSH connections (BOSH already has timeouts) | |
| 37 session.idle_watchdog = new_watchdog(idle_timeout, check_session); | |
| 38 session.idle_watchdog.session = session; | |
| 39 filters.add_filter(session, "bytes/in", update_watchdog); | |
| 40 end | |
| 41 end | |
| 42 | |
| 43 function unwatch_session(session) | |
| 44 if session.idle_watchdog then | |
|
3103
5bf79bb3cf7e
Neuter 0198 from mod_pinger, fix #712
Georg Lukas <georg@op-co.de>
parents:
2674
diff
changeset
|
45 filters.remove_filter(session, "bytes/in", update_watchdog); |
| 2034 | 46 session.idle_watchdog:cancel(); |
| 47 session.idle_watchdog = nil; | |
| 48 end | |
| 49 end | |
| 50 | |
| 51 module:hook("resource-bind", function (event) watch_session(event.session); end); | |
| 52 module:hook("resource-unbind", function (event) unwatch_session(event.session); end); |