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:
parent
6dd3223249
commit
616fdf3498
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue