mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-04 21:29:21 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user