Skip to content

Commit

Permalink
Fix compile error from resolver::iterator on pre 1.66 boost
Browse files Browse the repository at this point in the history
  • Loading branch information
loonycyborg committed Mar 8, 2021
1 parent 66848be commit c1f534c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/network_asio.cpp
Expand Up @@ -214,7 +214,12 @@ void connection::fallback_to_unencrypted()
utils::get<raw_socket>(socket_).close();

utils::get<raw_socket>(socket_).async_connect(endpoint,
std::bind(&connection::handle_connect, this, std::placeholders::_1, endpoint));
#if BOOST_VERSION >= 106600
std::bind(&connection::handle_connect, this, std::placeholders::_1, endpoint)
#else
std::bind(&connection::handle_connect, this, std::placeholders::_1, resolver_.resolve(endpoint))
#endif
);
}

void connection::transfer(const config& request, config& response)
Expand Down
7 changes: 6 additions & 1 deletion src/wesnothd_connection.cpp
Expand Up @@ -259,7 +259,12 @@ void wesnothd_connection::fallback_to_unencrypted()
utils::get<raw_socket>(socket_).close();

utils::get<raw_socket>(socket_).async_connect(endpoint,
std::bind(&wesnothd_connection::handle_connect, this, std::placeholders::_1, endpoint));
#if BOOST_VERSION >= 106600
std::bind(&wesnothd_connection::handle_connect, this, std::placeholders::_1, endpoint)
#else
std::bind(&wesnothd_connection::handle_connect, this, std::placeholders::_1, resolver_.resolve(endpoint))
#endif
);
}

// main thread
Expand Down

0 comments on commit c1f534c

Please sign in to comment.