diff --git a/td/telegram/Client.cpp b/td/telegram/Client.cpp index 7425654e1..d936cb8e4 100644 --- a/td/telegram/Client.cpp +++ b/td/telegram/Client.cpp @@ -429,7 +429,11 @@ class MultiImplPool { if (impls_.empty()) { init_openssl_threads(); - impls_.resize(clamp(thread::hardware_concurrency(), 8u, 20u) * 5 / 4); + auto max_client_threads = clamp(thread::hardware_concurrency(), 8u, 20u) * 5 / 4; +#if TD_OPENBSD + max_client_threads = td::min(max_client_threads, 7u); +#endif + impls_.resize(max_client_threads); CHECK(impls_.size() * (1 + MultiImpl::ADDITIONAL_THREAD_COUNT + 1 /* IOCP */) < 128); net_query_stats_ = std::make_shared(); diff --git a/test/tdclient.cpp b/test/tdclient.cpp index a914c254f..6013f795e 100644 --- a/test/tdclient.cpp +++ b/test/tdclient.cpp @@ -868,7 +868,7 @@ TEST(Client, Simple) { } TEST(Client, SimpleMulti) { - std::vector clients(40); + std::vector clients(7); //for (auto &client : clients) { //client.execute({1, td::td_api::make_object("td_requests", 1)}); //}