diff options
author | dscho <dscho> | 2003-02-10 20:09:20 +0000 |
---|---|---|
committer | dscho <dscho> | 2003-02-10 20:09:20 +0000 |
commit | d3bb5fb6eb920b7149fa5544ef893afa038b772c (patch) | |
tree | 3745bf6ef54f3b8822430a9cd4d37fe080f56003 /rfbserver.c | |
parent | 2a48679c1c790f1e73ada20be0b73b2be604eabd (diff) | |
download | libtdevnc-d3bb5fb6eb920b7149fa5544ef893afa038b772c.tar.gz libtdevnc-d3bb5fb6eb920b7149fa5544ef893afa038b772c.zip |
fixed a bug that prevented the first connection to be closed
Diffstat (limited to 'rfbserver.c')
-rw-r--r-- | rfbserver.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/rfbserver.c b/rfbserver.c index 9f79b47..f8b273c 100644 --- a/rfbserver.c +++ b/rfbserver.c @@ -119,6 +119,21 @@ rfbGetClientIterator(rfbScreenInfoPtr rfbScreen) } rfbClientPtr +rfbClientIteratorHead(rfbClientIteratorPtr i) +{ +#ifdef HAVE_LIBPTHREAD + if(i->next != 0) { + rfbDecrClientRef(i->next); + rfbIncrClientRef(i->screen->rfbClientHead); + } +#endif + LOCK(rfbClientListMutex); + i->next = i->screen->rfbClientHead; + UNLOCK(rfbClientListMutex); + return i->next; +} + +rfbClientPtr rfbClientIteratorNext(rfbClientIteratorPtr i) { if(i->next == 0) { @@ -396,7 +411,8 @@ rfbClientConnectionGone(cl) LOCK(cl->refCountMutex); if(cl->refCount) { UNLOCK(cl->refCountMutex); - WAIT(cl->deleteCond,cl->refCountMutex); + if(cl->screen->backgroundLoop != FALSE) + WAIT(cl->deleteCond,cl->refCountMutex); } else { UNLOCK(cl->refCountMutex); } |