diff options
| author | Alexander Blair <snipa@jagtech.io> | 2021-01-01 22:35:59 -0800 |
|---|---|---|
| committer | Alexander Blair <snipa@jagtech.io> | 2021-01-01 22:35:59 -0800 |
| commit | 16c780d5688c7931ca6f55537c9cc8c1d4abc3dd (patch) | |
| tree | 9efba2d35c48d1f6b592d54211b1bd52bfed0a36 /tests/unit_tests | |
| parent | 3bf0721ae603f3efd8aeaa8e44b41b6c47bd4b83 (diff) | |
| parent | 61b6e4cc67abd61a0dbffe271ee3f355b2e772bc (diff) | |
| download | monzero-core-16c780d5688c7931ca6f55537c9cc8c1d4abc3dd.tar.gz monzero-core-16c780d5688c7931ca6f55537c9cc8c1d4abc3dd.tar.xz monzero-core-16c780d5688c7931ca6f55537c9cc8c1d4abc3dd.zip | |
Merge pull request #7250
61b6e4cc6 Add aggressive restrictions to pre-handshake p2p buffer limit (Lee Clagett)
Diffstat (limited to 'tests/unit_tests')
| -rw-r--r-- | tests/unit_tests/epee_levin_protocol_handler_async.cpp | 3 | ||||
| -rw-r--r-- | tests/unit_tests/levin.cpp | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/unit_tests/epee_levin_protocol_handler_async.cpp b/tests/unit_tests/epee_levin_protocol_handler_async.cpp index ab6791324..3dbb36171 100644 --- a/tests/unit_tests/epee_levin_protocol_handler_async.cpp +++ b/tests/unit_tests/epee_levin_protocol_handler_async.cpp @@ -43,6 +43,8 @@ namespace { struct test_levin_connection_context : public epee::net_utils::connection_context_base { + static constexpr int handshake_command() noexcept { return 1001; } + static constexpr bool handshake_complete() noexcept { return true; } }; typedef epee::levin::async_protocol_handler_config<test_levin_connection_context> test_levin_protocol_handler_config; @@ -193,6 +195,7 @@ namespace { m_handler_config.set_handler(m_pcommands_handler, [](epee::levin::levin_commands_handler<test_levin_connection_context> *handler) { delete handler; }); m_handler_config.m_invoke_timeout = invoke_timeout; + m_handler_config.m_initial_max_packet_size = max_packet_size; m_handler_config.m_max_packet_size = max_packet_size; } diff --git a/tests/unit_tests/levin.cpp b/tests/unit_tests/levin.cpp index 2ad149afe..dc854ef0c 100644 --- a/tests/unit_tests/levin.cpp +++ b/tests/unit_tests/levin.cpp @@ -178,6 +178,7 @@ namespace { using base_type = epee::net_utils::connection_context_base; static_cast<base_type&>(context_) = base_type{random_generator(), {}, is_incoming, false}; + context_.m_state = cryptonote::cryptonote_connection_context::state_normal; handler_.after_init_connection(); } |
