From f547ed72f9fe77e7bf503982fec4fced8b77cfa6 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sun, 29 Nov 2020 18:29:18 +0000 Subject: [PATCH] Decrement pending requests when sending pseudo frames --- src/server.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/server.c b/src/server.c index f1f7f24..065e3ff 100644 --- a/src/server.c +++ b/src/server.c @@ -521,16 +521,21 @@ static void process_fb_update_requests(struct nvnc_client* client) client->has_pixfmt = true; } - // TODO: Return if there are no pending requests after this if (fb->width != client->known_width - || fb->height != client->known_height) + || fb->height != client->known_height) { send_desktop_resize(client, fb); - // TODO: Return if there are no pending requests after this + if (--client->n_pending_requests <= 0) + return; + } + if (server->key_code_fn && !client->is_qemu_key_ext_notified && client_has_encoding(client, RFB_ENCODING_QEMU_EXT_KEY_EVENT)) { send_qemu_key_ext_frame(client); client->is_qemu_key_ext_notified = true; + + if (--client->n_pending_requests <= 0) + return; } DTRACE_PROBE1(neatvnc, update_fb_start, client);