aboutsummaryrefslogtreecommitdiff
path: root/tests/net_load_tests/srv.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-11-14 14:54:05 +0200
committerRiccardo Spagni <ric@spagni.net>2017-11-14 14:54:05 +0200
commit9317c9c57e72de315f0b53ebc73fce215ed1021f (patch)
treec66af7854ae62f7d1d320963c25ec37f12be6ee5 /tests/net_load_tests/srv.cpp
parentMerge pull request #2615 (diff)
parentFix an object lifetime bug in net load tests (diff)
downloadmonero-9317c9c57e72de315f0b53ebc73fce215ed1021f.tar.xz
Merge pull request #2617
7dbf76d0 Fix an object lifetime bug in net load tests (moneromooo-monero)
Diffstat (limited to 'tests/net_load_tests/srv.cpp')
-rw-r--r--tests/net_load_tests/srv.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/net_load_tests/srv.cpp b/tests/net_load_tests/srv.cpp
index e6dee1639..f0b0889ea 100644
--- a/tests/net_load_tests/srv.cpp
+++ b/tests/net_load_tests/srv.cpp
@@ -224,8 +224,8 @@ int main(int argc, char** argv)
if (!tcp_server.init_server(srv_port, "127.0.0.1"))
return 1;
- srv_levin_commands_handler commands_handler(tcp_server);
- tcp_server.get_config_object().m_pcommands_handler = &commands_handler;
+ srv_levin_commands_handler *commands_handler = new srv_levin_commands_handler(tcp_server);
+ tcp_server.get_config_object().set_handler(commands_handler, [](epee::levin::levin_commands_handler<test_connection_context> *handler) { delete handler; });
tcp_server.get_config_object().m_invoke_timeout = 10000;
//tcp_server.get_config_object().m_max_packet_size = max_packet_size;