diff plugins/mod_limits.lua @ 14024:f65302ea37b0 13.0 13.0.3

mod_limits: Allow configuration of general 's2s' limit, and have s2sout inherit from s2sin Most people don't currently have a limit set for s2sout, as usually such sessions don't have significant incoming traffic. However, having limits in place is still sensible, especially with the rising use of bidi. The goal here is to switch people to a general 's2s' limit, which s2sin and s2sout both inherit from. Due to the widespread existence of 's2sin' in existing configurations, s2sout will inherit from that unless explicitly set.
author Matthew Wild <mwild1@gmail.com>
date Mon, 05 Jan 2026 11:35:32 +0000
parents c8d949cf6b09
children 4087c5b600b1
line wrap: on
line diff
--- a/plugins/mod_limits.lua	Tue Dec 09 21:41:34 2025 +0100
+++ b/plugins/mod_limits.lua	Mon Jan 05 11:35:32 2026 +0000
@@ -44,7 +44,7 @@
 		bytes_per_second = 10 * 1024;
 		burst_seconds = 2;
 	};
-	s2sin = {
+	s2s = {
 		bytes_per_second = 30 * 1024;
 		burst_seconds = 2;
 	};
@@ -57,6 +57,13 @@
 	};
 end
 
+if not limits.s2sin and limits.s2s then
+	limits.s2sin = limits.s2s;
+end
+if not limits.s2sout then
+	limits.s2sout = limits.s2s or limits.s2sin;
+end
+
 local default_filter_set = {};
 
 function default_filter_set.bytes_in(bytes, session)