Handle all buffered messages in the socket handler

Otherwise, some buffered messages will be left over
libvncclient-integration
Andri Yngvason 2022-06-29 11:49:44 +00:00
parent 8bc25aa700
commit cde18272ce
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))
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);
return rc;
}