diff --git a/include/ylt/coro_rpc/impl/coro_rpc_client.hpp b/include/ylt/coro_rpc/impl/coro_rpc_client.hpp index cbc86ad4e..19b67740a 100644 --- a/include/ylt/coro_rpc/impl/coro_rpc_client.hpp +++ b/include/ylt/coro_rpc/impl/coro_rpc_client.hpp @@ -339,6 +339,8 @@ class coro_rpc_client { friend class coro_io::client_pool; private: + // the const char * will convert to bool instead of std::string_view + // use this struct to prevent it. struct is_reconnect_t { bool value = false; }; diff --git a/src/coro_rpc/tests/test_coro_rpc_client.cpp b/src/coro_rpc/tests/test_coro_rpc_client.cpp index 24c72e05a..cfa849592 100644 --- a/src/coro_rpc/tests/test_coro_rpc_client.cpp +++ b/src/coro_rpc/tests/test_coro_rpc_client.cpp @@ -457,7 +457,7 @@ TEST_CASE("testing client sync connect, unit test inject only") { server.async_start().start([](auto&&) { }); CHECK_MESSAGE(server.wait_for_start(3s), "server start timeout"); - coro_rpc_client client2(g_client_id++); + coro_rpc_client client2(*coro_io::get_global_executor(), g_client_id++); bool ok = client2.init_ssl("../openssl_files", "server.crt"); CHECK(ok == true); val = client2.sync_connect("127.0.0.1", "8801");