[client] be quicker at detecting restart and quieter about it

This commit is contained in:
Geoffrey McRae 2020-08-11 14:52:22 +10:00
parent fa50b7824c
commit bfb12c74fb
2 changed files with 5 additions and 3 deletions

View file

@ -1 +1 @@
B2-rc3-10-gda8b2d0cec+1
B2-rc3-11-gfa50b7824c+1

View file

@ -1500,6 +1500,9 @@ restart:
if (!state.running)
return -1;
// dont show warnings again after the first startup
waitCount = 100;
const bool magicMatches = memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) == 0;
if (udataSize != sizeof(KVMFR) || !magicMatches || udata->version != KVMFR_VERSION)
{
@ -1541,10 +1544,9 @@ restart:
if (!lgmpClientSessionValid(state.lgmp))
{
state.restart = true;
DEBUG_WARN("Session is invalid, has the host shutdown?");
break;
}
SDL_WaitEventTimeout(NULL, 1000);
SDL_WaitEventTimeout(NULL, 100);
}
if (state.restart)