Skip to content

Commit

Permalink
Prevent hang in case of connecting to old server not supporting new h…
Browse files Browse the repository at this point in the history
…andshake value
  • Loading branch information
loonycyborg committed Feb 13, 2021
1 parent a2115bd commit a38198e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wesnothd_connection.cpp
Expand Up @@ -165,6 +165,9 @@ void wesnothd_connection::handle_handshake(const error_code& ec)
{
MPTEST_LOG;
if(ec) {
if(ec == boost::asio::error::eof) {
throw std::runtime_error("Failed to complete handshake with server");
}
LOG_NW << __func__ << " Throwing: " << ec << "\n";
throw system_error(ec);
}
Expand Down

0 comments on commit a38198e

Please sign in to comment.