mirror of
https://github.com/wownero/wownero.git
synced 2026-11-26 02:33:55 +01:00
net: cap aggregate ZMQ receive size
(cherry picked from commit 4f6652f356f804403f46ecbbb8b90c1c03abbc64)
This commit is contained in:
@@ -46,7 +46,7 @@ namespace cryptonote
|
||||
namespace
|
||||
{
|
||||
constexpr const int num_zmq_threads = 1;
|
||||
constexpr const std::int64_t max_message_size = 10 * 1024 * 1024; // 10 MiB
|
||||
constexpr const std::int64_t max_frame_size = net::zmq::max_message_size;
|
||||
constexpr const std::chrono::seconds linger_timeout{2}; // wait period for pending out messages
|
||||
|
||||
net::zmq::socket init_socket(void* context, int type, epee::span<const std::string> addresses)
|
||||
@@ -62,7 +62,7 @@ namespace
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (zmq_setsockopt(out.get(), ZMQ_MAXMSGSIZE, std::addressof(max_message_size), sizeof(max_message_size)) != 0)
|
||||
if (zmq_setsockopt(out.get(), ZMQ_MAXMSGSIZE, std::addressof(max_frame_size), sizeof(max_frame_size)) != 0)
|
||||
{
|
||||
MONERO_LOG_ZMQ_ERROR("Failed to set maximum incoming message size");
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user