summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2016-12-28 19:41:52 +0100
committerChristian Beier <dontmind@freeshell.org>2016-12-28 19:41:52 +0100
commit78b101f09d01141488261b96dcc01c9aec5f1649 (patch)
tree814e9604f530b1936177e89d06650bb2d6958742
parent227e1d76abe409a8d1b7a78ddeb885534660964e (diff)
downloadlibtdevnc-78b101f0.tar.gz
libtdevnc-78b101f0.zip
LibVNCServer: fix starting of an onHold-client in threaded mode.
Discovered by madscientist159 on 11 Jan 2015: "noted in testing with the threaded server build, whereby if newClientHook() returned RFB_CLIENT_ON_HOLD there was no way to release the hold when the server became ready"
-rw-r--r--libvncserver/main.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libvncserver/main.c b/libvncserver/main.c
index 47dac11..dbda77d 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.c
@@ -612,21 +612,18 @@ listenerRun(void *data)
return(NULL);
}
-void
-rfbStartOnHoldClient(rfbClientPtr cl)
-{
- pthread_create(&cl->client_thread, NULL, clientInput, (void *)cl);
-}
-
-#else
+#endif
void
rfbStartOnHoldClient(rfbClientPtr cl)
{
- cl->onHold = FALSE;
+ cl->onHold = FALSE;
+#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
+ if(cl->screen->backgroundLoop)
+ pthread_create(&cl->client_thread, NULL, clientInput, (void *)cl);
+#endif
}
-#endif
void
rfbRefuseOnHoldClient(rfbClientPtr cl)