Skip to content

Commit

Permalink
fix: fix compilation with Boost 1.87.0
Browse files Browse the repository at this point in the history
boost::asio::ip::address(error_code & ec) was deprecated and removed in Boost 1.87.0.
  • Loading branch information
deniskovalchuk committed Dec 18, 2024
1 parent 7f33438 commit a7ecd5e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/net_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ namespace ftp::detail::net_utils

std::string address_to_string(const boost::asio::ip::address & address)
{
boost::system::error_code ec;

std::string string = address.to_string(ec);

if (ec)
try
{
return address.to_string();
}
catch (const boost::system::error_code & ec)
{
throw ftp_exception(ec, "Cannot get address string");
}

return string;
}

} // namespace ftp::detail::net_utils

0 comments on commit a7ecd5e

Please sign in to comment.