Detect disconnect when waiting on data from server

Fixes issue #2927.
Also shows that issue #2925 still results in a disconnect but the client
does not get stuck anymore at least.
This commit is contained in:
Gunter Labes 2018-04-21 11:14:34 +02:00
parent 6dd3223249
commit 616fdf3498

View file

@ -407,6 +407,10 @@ bool wesnothd_connection::wait_and_receive_data(config& data)
{
while(!has_data_received()) {
SDL_Delay(1);
std::lock_guard<std::mutex> lock(last_error_mutex_);
if(last_error_) {
break;
}
}
return receive_data(data);