summaryrefslogtreecommitdiffstats
path: root/libvncserver/rfbserver.c
diff options
context:
space:
mode:
authordscho <dscho>2006-01-10 14:07:58 +0000
committerdscho <dscho>2006-01-10 14:07:58 +0000
commit0b7a0030acc27377b01e3afa41f672dc4d6a7561 (patch)
tree7499d9d059b095970be9e0e8312004e5fe348dd2 /libvncserver/rfbserver.c
parent71f2ec79180185a6c3db0c87f9d53c491dc31e76 (diff)
downloadlibtdevnc-0b7a0030acc27377b01e3afa41f672dc4d6a7561.tar.gz
libtdevnc-0b7a0030acc27377b01e3afa41f672dc4d6a7561.zip
rfbProcessEvents() has to iterate also over clients with sock < 0 to close them
Diffstat (limited to 'libvncserver/rfbserver.c')
-rw-r--r--libvncserver/rfbserver.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index 7c620c8..8fab930 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -98,6 +98,7 @@ static MUTEX(rfbClientListMutex);
struct rfbClientIterator {
rfbClientPtr next;
rfbScreenInfoPtr screen;
+ rfbBool closedToo;
};
void
@@ -120,6 +121,18 @@ rfbGetClientIterator(rfbScreenInfoPtr rfbScreen)
(rfbClientIteratorPtr)malloc(sizeof(struct rfbClientIterator));
i->next = NULL;
i->screen = rfbScreen;
+ i->closedToo = FALSE;
+ return i;
+}
+
+rfbClientIteratorPtr
+rfbGetClientIteratorWithClosed(rfbScreenInfoPtr rfbScreen)
+{
+ rfbClientIteratorPtr i =
+ (rfbClientIteratorPtr)malloc(sizeof(struct rfbClientIterator));
+ i->next = NULL;
+ i->screen = rfbScreen;
+ i->closedToo = TRUE;
return i;
}
@@ -152,8 +165,9 @@ rfbClientIteratorNext(rfbClientIteratorPtr i)
}
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
- while(i->next && i->next->sock<0)
- i->next = i->next->next;
+ if(!i->closedToo)
+ while(i->next && i->next->sock<0)
+ i->next = i->next->next;
if(i->next)
rfbIncrClientRef(i->next);
#endif