From 9e84000e0afc89388335e0b70a185ff8836bcfea Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 26 Sep 2020 22:29:02 +0000 Subject: [PATCH] server: Extract finish_fb_update() from on_client_update_fb_done() --- src/server.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/server.c b/src/server.c index a3d9939..b40355c 100644 --- a/src/server.c +++ b/src/server.c @@ -1133,14 +1133,8 @@ static void do_client_update_fb(void* work) } } -static void on_client_update_fb_done(void* work) +static void finish_fb_update(struct nvnc_client* client, struct vec* frame) { - struct fb_update_work* update = aml_get_userdata(work); - struct nvnc_client* client = update->client; - struct vec* frame = &update->frame; - - nvnc_fb_unref(update->fb); - client_ref(client); if (client->net_stream->state != STREAM_STATE_CLOSED) { @@ -1158,6 +1152,17 @@ static void on_client_update_fb_done(void* work) client->n_pending_requests--; DTRACE_PROBE1(neatvnc, update_fb_done, client); +} + +static void on_client_update_fb_done(void* work) +{ + struct fb_update_work* update = aml_get_userdata(work); + struct nvnc_client* client = update->client; + struct vec* frame = &update->frame; + + nvnc_fb_unref(update->fb); + + finish_fb_update(client, frame); pixman_region_fini(&update->region);