aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-01-06 21:08:11 -0500
committerluigi1111 <luigi1111w@gmail.com>2021-01-06 21:08:11 -0500
commit7ecdc53e11e01366ee24ed2096291f360aa50402 (patch)
tree2e89844b2906b047a865f2d114ac9d4bb4cf581d /tests
parentMerge pull request #7269 (diff)
parentadd a max levin packet size by command type (diff)
downloadmonero-7ecdc53e11e01366ee24ed2096291f360aa50402.tar.xz
Merge pull request #7248
3c7eec1 add a max levin packet size by command type (moneromooo-monero)
Diffstat (limited to 'tests')
-rw-r--r--tests/fuzz/levin.cpp1
-rw-r--r--tests/net_load_tests/net_load_tests.h1
-rw-r--r--tests/unit_tests/epee_levin_protocol_handler_async.cpp1
3 files changed, 3 insertions, 0 deletions
diff --git a/tests/fuzz/levin.cpp b/tests/fuzz/levin.cpp
index 0ba0ff7f3..86b370202 100644
--- a/tests/fuzz/levin.cpp
+++ b/tests/fuzz/levin.cpp
@@ -54,6 +54,7 @@ namespace
{
static constexpr int handshake_command() noexcept { return 1001; }
static constexpr bool handshake_complete() noexcept { return true; }
+ size_t get_max_bytes(int command) const { return LEVIN_DEFAULT_MAX_PACKET_SIZE; }
};
typedef epee::levin::async_protocol_handler_config<test_levin_connection_context> test_levin_protocol_handler_config;
diff --git a/tests/net_load_tests/net_load_tests.h b/tests/net_load_tests/net_load_tests.h
index 1cc68746a..bc69e662f 100644
--- a/tests/net_load_tests/net_load_tests.h
+++ b/tests/net_load_tests/net_load_tests.h
@@ -50,6 +50,7 @@ namespace net_load_tests
test_connection_context(): epee::net_utils::connection_context_base(boost::uuids::nil_uuid(), {}, false, false), m_closed(false) {}
static constexpr int handshake_command() noexcept { return 1001; }
static constexpr bool handshake_complete() noexcept { return true; }
+ size_t get_max_bytes(int command) const { return LEVIN_DEFAULT_MAX_PACKET_SIZE; }
volatile bool m_closed;
};
diff --git a/tests/unit_tests/epee_levin_protocol_handler_async.cpp b/tests/unit_tests/epee_levin_protocol_handler_async.cpp
index 55092fd90..f1969ca18 100644
--- a/tests/unit_tests/epee_levin_protocol_handler_async.cpp
+++ b/tests/unit_tests/epee_levin_protocol_handler_async.cpp
@@ -45,6 +45,7 @@ namespace
{
static constexpr int handshake_command() noexcept { return 1001; }
static constexpr bool handshake_complete() noexcept { return true; }
+ size_t get_max_bytes(int command) const { return LEVIN_DEFAULT_MAX_PACKET_SIZE; }
};
typedef epee::levin::async_protocol_handler_config<test_levin_connection_context> test_levin_protocol_handler_config;