Give network.xmlrpc.size_limit.set a floor

A limit below any valid request rejects the request that would raise it again.
This commit is contained in:
xirvik
2026-09-19 02:23:52 +00:00
committed by Jari Sundell
parent 4e7129c71c
commit 8ee3b984dd
5 changed files with 48 additions and 1 deletions
+3
View File
@@ -172,6 +172,9 @@ RpcManager::set_size_limit(uint64_t size) {
if (size > SCgiTask::max_content_size)
throw torrent::input_error("XMLRPC size limit cannot exceed the SCGI content size limit.");
if (size < min_size_limit)
throw torrent::input_error("XMLRPC size limit is too small to hold a request.");
m_xmlrpc.set_size_limit(size);
}
+4
View File
@@ -53,6 +53,10 @@ public:
enum RPCType { XML,
JSON };
// A limit below the shortest useful request rejects every request, the one
// that would raise it again included.
static constexpr uint64_t min_size_limit = 1024;
RpcManager() = default;
~RpcManager() = default;