From a38198e2af271c6e946dc0f5d57f606d8a444d28 Mon Sep 17 00:00:00 2001 From: loonycyborg Date: Mon, 8 Feb 2021 17:25:52 +0300 Subject: [PATCH] Prevent hang in case of connecting to old server not supporting new handshake value --- src/wesnothd_connection.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wesnothd_connection.cpp b/src/wesnothd_connection.cpp index 995edcb321dd..61e1db88ea6e 100644 --- a/src/wesnothd_connection.cpp +++ b/src/wesnothd_connection.cpp @@ -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); }