Handle all buffered messages in the socket handler

Otherwise, some buffered messages will be left over
pull/12/head
Andri Yngvason 2022-06-29 11:49:44 +00:00
parent 2b99d0c019
commit cf56a1f416
1 changed files with 7 additions and 1 deletions

View File

@ -368,7 +368,13 @@ int vnc_client_process(struct vnc_client* self)
if (!vnc_client_lock_handler(self)) if (!vnc_client_lock_handler(self))
return 0; return 0;
int rc = HandleRFBServerMessage(self->client) ? 0 : -1; int rc;
while (self->client->buffered > 0) {
rc = HandleRFBServerMessage(self->client) ? 0 : -1;
if (rc < 0)
break;
}
vnc_client_unlock_handler(self); vnc_client_unlock_handler(self);
return rc; return rc;
} }