Skip to content

Commit

Permalink
fix: compilation with gcc/C++20
Browse files Browse the repository at this point in the history
For some reason there is a weird template instantiation that breaks with the lambda auto parameter.
  • Loading branch information
tilsche committed Dec 3, 2023
1 parent e72eafc commit f6a25c5
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/connection_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,21 @@ void AsioConnectionHandler::connect(const AMQP::Address& address)

void AsioConnectionHandler::connect(asio::ip::tcp::resolver::iterator endpoint_iterator)
{
asio::async_connect(this->underlying_socket(), endpoint_iterator, asio::ip::tcp::resolver::iterator(),
[this](const auto& error, auto successful_endpoint) {
if (error)
{
log::error("[{}] Failed to connect to: {}", name_, error.message());
this->onError("Connect failed");
return;
}
log::debug("[{}] Established connection to {} at {}", name_,
successful_endpoint->host_name(),
successful_endpoint->endpoint());

this->handshake(successful_endpoint->host_name());
});
asio::async_connect(
this->underlying_socket(), endpoint_iterator, asio::ip::tcp::resolver::iterator(),
[this](const std::error_code& error,
asio::ip::tcp::resolver::iterator successful_endpoint) {
if (error)
{
log::error("[{}] Failed to connect to: {}", name_, error.message());
this->onError("Connect failed");
return;
}
log::debug("[{}] Established connection to {} at {}", name_,
successful_endpoint->host_name(), successful_endpoint->endpoint());

this->handshake(successful_endpoint->host_name());
});
}

void PlainConnectionHandler::handshake(const std::string& hostname)
Expand Down

0 comments on commit f6a25c5

Please sign in to comment.