Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing hunter build and few c++ errors #549

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ include(silkworm/third_party/evmone/cmake/cable/bootstrap.cmake)
include(CableBuildInfo)
include(silkworm/third_party/evmone/cmake/cable/HunterGate.cmake)
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.24.3.tar.gz"
SHA1 "10738b59e539818a01090e64c2d09896247530c7"
URL "https://github.com/cpp-pm/hunter/archive/v0.24.16.tar.gz"
SHA1 "09668c254f01afeca1b3d3d2e4692ed5e0e39dcc"
FILEPATH "${CMAKE_SOURCE_DIR}/cmake/Hunter/config.cmake"
)

Expand Down
11 changes: 1 addition & 10 deletions cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,4 @@
]]

# silkworm configuration
include(${CMAKE_SOURCE_DIR}/silkworm/cmake/Hunter/config.cmake)

hunter_config(
asio-grpc
VERSION 2.0.0
URL https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.0.0.tar.gz
SHA1 a727806a5c93c811e8f73ecb1e733efc4739d5ff
CMAKE_ARGS
ASIO_GRPC_USE_BOOST_CONTAINER=ON
)
include(${CMAKE_SOURCE_DIR}/silkworm/cmake/Hunter/config.cmake)
1 change: 1 addition & 0 deletions cmd/engine_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <filesystem>
#include <iostream>
#include <string>
#include <fstream>

#include <boost/process/environment.hpp>
#include <boost/filesystem.hpp>
Expand Down
13 changes: 9 additions & 4 deletions silkrpc/http/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,27 @@ boost::asio::awaitable<void> Server::run() {
SILKRPC_DEBUG << "Server::run accepting using io_context " << io_context << "...\n" << std::flush;

std::shared_ptr<Connection> new_connection;
bool wait_and_continue = false;

try {
new_connection = std::make_shared<Connection>(context_, workers_, handler_table_);
co_await acceptor_.async_accept(new_connection->socket(), boost::asio::use_awaitable);
} catch (const boost::system::system_error& se) {
if (se.code() == boost::asio::error::no_descriptors) {
SILKRPC_WARN << "Server::run too many open connections\n" << std::flush;
boost::asio::steady_timer timer(acceptor_.get_executor());
timer.expires_after(boost::asio::chrono::milliseconds(100));
co_await timer.async_wait(boost::asio::use_awaitable);
continue;
wait_and_continue = true;
} else {
throw;
}
}

if (wait_and_continue) {
boost::asio::steady_timer timer(acceptor_.get_executor());
timer.expires_after(boost::asio::chrono::milliseconds(100));
co_await timer.async_wait(boost::asio::use_awaitable);
continue;
}

if (!acceptor_.is_open()) {
SILKRPC_TRACE << "Server::run returning...\n";
co_return;
Expand Down