Index: vino/ChangeLog =================================================================== --- vino.orig/ChangeLog 2006-10-20 10:18:21.000000000 +0100 +++ vino.orig/ChangeLog 2006-10-20 10:18:21.000000000 +0100 @@ -0,0 +0,26 @@ +2006-10-20 Mark McLoughlin + + * vino/server/libvncserver/main.c, + vino/server/libvncserver/sockets.c, + vino/server/libvncserver/rfbserver.c, + vino/server/libvncserver/rfb/rfb.h: remove + a heap of threading stuff which we don't + use. + + * vino/server/libvncserver/CHANGES: add note. + +2006-10-20 Mark McLoughlin + + Remove some unused sockets code so we don't have + to fix it for IPv6 support. + + * vino/server/libvncserver/sockets.c: + (rfbProcessNewConnection): remove libwrap usage + (rfbConnect), (ConnectToTcpAddr): remove unused + functions + + * vino/server/libvncserver/rfb/rfb.h: remove + rfbConnect() and ConnectToTcpAddr() + + * vino/server/libvncserver/CHANGES: add note + Index: vino/server/libvncserver/rfb/rfb.h =================================================================== --- vino.orig/server/libvncserver/rfb/rfb.h 2006-10-20 10:17:54.000000000 +0100 +++ vino.orig/server/libvncserver/rfb/rfb.h 2006-10-20 10:17:54.000000000 +0100 @@ -49,69 +49,11 @@ extern "C" #include #endif -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD -#include -#if 0 /* debugging */ -#define LOCK(mutex) (rfbLog("%s:%d LOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_lock(&(mutex))) -#define UNLOCK(mutex) (rfbLog("%s:%d UNLOCK(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_unlock(&(mutex))) -#define MUTEX(mutex) pthread_mutex_t (mutex) -#define INIT_MUTEX(mutex) (rfbLog("%s:%d INIT_MUTEX(%s,0x%x)\n",__FILE__,__LINE__,#mutex,&(mutex)), pthread_mutex_init(&(mutex),NULL)) -#define TINI_MUTEX(mutex) (rfbLog("%s:%d TINI_MUTEX(%s)\n",__FILE__,__LINE__,#mutex), pthread_mutex_destroy(&(mutex))) -#define TSIGNAL(cond) (rfbLog("%s:%d TSIGNAL(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_signal(&(cond))) -#define WAIT(cond,mutex) (rfbLog("%s:%d WAIT(%s,%s)\n",__FILE__,__LINE__,#cond,#mutex), pthread_cond_wait(&(cond),&(mutex))) -#define COND(cond) pthread_cond_t (cond) -#define INIT_COND(cond) (rfbLog("%s:%d INIT_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_init(&(cond),NULL)) -#define TINI_COND(cond) (rfbLog("%s:%d TINI_COND(%s)\n",__FILE__,__LINE__,#cond), pthread_cond_destroy(&(cond))) -#define IF_PTHREADS(x) x -#else -#define LOCK(mutex) pthread_mutex_lock(&(mutex)); -#define UNLOCK(mutex) pthread_mutex_unlock(&(mutex)); -#define MUTEX(mutex) pthread_mutex_t (mutex) -#define INIT_MUTEX(mutex) pthread_mutex_init(&(mutex),NULL) -#define TINI_MUTEX(mutex) pthread_mutex_destroy(&(mutex)) -#define TSIGNAL(cond) pthread_cond_signal(&(cond)) -#define WAIT(cond,mutex) pthread_cond_wait(&(cond),&(mutex)) -#define COND(cond) pthread_cond_t (cond) -#define INIT_COND(cond) pthread_cond_init(&(cond),NULL) -#define TINI_COND(cond) pthread_cond_destroy(&(cond)) -#define IF_PTHREADS(x) x -#endif -#else #define LOCK(mutex) #define UNLOCK(mutex) -#define MUTEX(mutex) -#define INIT_MUTEX(mutex) -#define TINI_MUTEX(mutex) -#define TSIGNAL(cond) -#define WAIT(cond,mutex) this_is_unsupported -#define COND(cond) -#define INIT_COND(cond) -#define TINI_COND(cond) -#define IF_PTHREADS(x) -#endif /* end of stuff for autoconf */ -/* if you use pthreads, but don't define LIBVNCSERVER_HAVE_LIBPTHREAD, the structs - get all mixed up. So this gives a linker error reminding you to compile - the library and your application (at least the parts including rfb.h) - with the same support for pthreads. */ -#if 0 -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD -#ifdef HAVE_LIBZ -#define rfbInitServer rfbInitServerWithPthreadsAndZRLE -#else -#define rfbInitServer rfbInitServerWithPthreadsButWithoutZRLE -#endif -#else -#ifdef HAVE_LIBZ -#define rfbInitServer rfbInitServerWithoutPthreadsButWithZRLE -#else -#define rfbInitServer rfbInitServerWithoutPthreadsAndZRLE -#endif -#endif -#endif - struct _rfbClientRec; struct _rfbScreenInfo; struct rfbCursor; @@ -225,11 +167,6 @@ typedef struct _rfbScreenInfo */ AuthenticatedClientHookPtr authenticatedClientHook; -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD - MUTEX(cursorMutex); - rfbBool backgroundLoop; -#endif - } rfbScreenInfo, *rfbScreenInfoPtr; @@ -275,10 +212,6 @@ typedef struct _rfbClientRec { rfbBool useTLS; #endif char *host; - -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD - pthread_t client_thread; -#endif /* Possible client states: */ enum { RFB_PROTOCOL_VERSION, /* establishing protocol version */ @@ -412,21 +345,6 @@ typedef struct _rfbClientRec { struct _rfbClientRec *prev; struct _rfbClientRec *next; -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD - /* whenever a client is referenced, the refCount has to be incremented - and afterwards decremented, so that the client is not cleaned up - while being referenced. - Use the functions rfbIncrClientRef(cl) and rfbDecrClientRef(cl); - */ - int refCount; - MUTEX(refCountMutex); - COND(deleteCond); - - MUTEX(outputMutex); - MUTEX(updateMutex); - COND(updateCond); -#endif - #ifdef HAVE_LIBZ void* zrleData; #endif @@ -478,8 +396,6 @@ extern int ReadExactTimeout(rfbClientPtr extern int WriteExact(rfbClientPtr cl, const char *buf, int len); extern void rfbProcessNewConnection(rfbScreenInfoPtr rfbScreen); extern void rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec); -extern int rfbConnect(rfbScreenInfoPtr rfbScreen, char* host, int port); -extern int ConnectToTcpAddr(char* host, int port); extern int ListenOnTCPPort(int port, rfbBool localOnly); /* rfbserver.c */ @@ -497,9 +413,6 @@ extern rfbClientPtr rfbClientIteratorHea extern rfbClientPtr rfbClientIteratorNext(rfbClientIteratorPtr iterator); extern void rfbReleaseClientIterator(rfbClientIteratorPtr iterator); -extern void rfbIncrClientRef(rfbClientPtr cl); -extern void rfbDecrClientRef(rfbClientPtr cl); - extern void rfbNewClientConnection(rfbScreenInfoPtr rfbScreen,int sock); extern rfbClientPtr rfbNewClient(rfbScreenInfoPtr rfbScreen,int sock); extern void rfbClientConnectionGone(rfbClientPtr cl); @@ -671,12 +584,6 @@ extern void rfbNewFramebuffer(rfbScreenI extern void rfbScreenCleanup(rfbScreenInfoPtr screenInfo); -/* functions to accept/refuse a client that has been put on hold - by a NewClientHookPtr function. Must not be called in other - situations. */ -extern void rfbStartOnHoldClient(rfbClientPtr cl); -extern void rfbRefuseOnHoldClient(rfbClientPtr cl); - /* call one of these two functions to service the vnc clients. usec are the microseconds the select on the fds waits. if you are using the event loop, set this to some value > 0, so the Index: vino/server/libvncserver/sockets.c =================================================================== --- vino.orig/server/libvncserver/sockets.c 2006-10-20 10:17:54.000000000 +0100 +++ vino.orig/server/libvncserver/sockets.c 2006-10-20 10:17:54.000000000 +0100 @@ -84,13 +84,6 @@ struct timeval #include -#ifdef USE_LIBWRAP -#include -#include -int allow_severity=LOG_INFO; -int deny_severity=LOG_WARNING; -#endif - /*#ifndef WIN32 int max(int i,int j) { return(irfbListenSock, - (struct sockaddr *)&addr, &addrlen)) < 0) { + if ((sock = accept(rfbScreen->rfbListenSock, NULL, NULL)) < 0) { rfbLogPerror("rfbCheckFds: accept"); return; } @@ -275,18 +265,6 @@ rfbProcessNewConnection(rfbScreenInfoPtr return; } -#ifdef USE_LIBWRAP - if(!hosts_ctl("vnc",STRING_UNKNOWN,inet_ntoa(addr.sin_addr), - STRING_UNKNOWN)) { - rfbLog("Rejected connection from client %s\n", - inet_ntoa(addr.sin_addr)); - close(sock); - return; - } -#endif - - rfbLog("Got connection from client %s\n", inet_ntoa(addr.sin_addr)); - rfbNewClient(rfbScreen,sock); } @@ -364,54 +342,10 @@ rfbCloseClient(cl) close(cl->sock); cl->sock = -1; } - TSIGNAL(cl->updateCond); UNLOCK(cl->updateMutex); } -/* - * rfbConnect is called to make a connection out to a given TCP address. - */ - -int -rfbConnect(rfbScreen, host, port) - rfbScreenInfoPtr rfbScreen; - char *host; - int port; -{ - int sock; - int one = 1; - - rfbLog("Making connection to client on host %s port %d\n", - host,port); - - if ((sock = ConnectToTcpAddr(host, port)) < 0) { - rfbLogPerror("connection failed"); - return -1; - } - -#ifndef WIN32 - if (fcntl(sock, F_SETFL, O_NONBLOCK) < 0) { - rfbLogPerror("fcntl failed"); - close(sock); - return -1; - } -#endif - - if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, - (char *)&one, sizeof(one)) < 0) { - rfbLogPerror("setsockopt failed"); - close(sock); - return -1; - } - - /* AddEnabledDevice(sock); */ - FD_SET(sock, &rfbScreen->allFds); - rfbScreen->maxFd = max(sock,rfbScreen->maxFd); - - return sock; -} - #ifdef HAVE_GNUTLS static int ReadExactOverTLS(rfbClientPtr cl, char* buf, int len, int timeout) @@ -647,37 +581,3 @@ ListenOnTCPPort(port, localOnly) return sock; } - -int -ConnectToTcpAddr(host, port) - char *host; - int port; -{ - struct hostent *hp; - int sock; - struct sockaddr_in addr; - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - - if ((addr.sin_addr.s_addr = inet_addr(host)) == INADDR_NONE) - { - if (!(hp = gethostbyname(host))) { - errno = EINVAL; - return -1; - } - addr.sin_addr.s_addr = *(unsigned long *)hp->h_addr; - } - - if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - return -1; - } - - if (connect(sock, (struct sockaddr *)&addr, (sizeof(addr))) < 0) { - close(sock); - return -1; - } - - return sock; -} Index: vino/server/libvncserver/CHANGES =================================================================== --- vino.orig/server/libvncserver/CHANGES 2006-10-20 10:17:54.000000000 +0100 +++ vino.orig/server/libvncserver/CHANGES 2006-10-20 10:17:54.000000000 +0100 @@ -52,8 +52,7 @@ + Warning fixes: o killed rfbPrintXCursor() - not used - o put rfbIncrClientRef(), rfbIncrClientRef() and - rfbClientIteratorHead() into rfb/rfb.h. They weren't + o put rfbClientIteratorHead() into rfb/rfb.h. It wasn't put there originally because they're "private", but there's loads of private stuff there already. Fixes "no previous prototype" warnings. @@ -117,8 +116,13 @@ packets (such as 100s of pen readings pe + removed the LIBVNCSERVER prefix from all the #ifdefs - + left all the threaded code disabled (LIBVNCSERVER_HAVE_LIBPTHREAD - is undefined) + + removed all the threading code + + + removed libwrap usage + + + removed rfbConnect() and ConnectToTcpAddr() + + + removed rfbStartOnHoldClient() and rfbRefuseOnHoldClient() + disabled the rfbInitServer name mangling in rfb/rfb.h Index: vino/server/libvncserver/main.c =================================================================== --- vino.orig/server/libvncserver/main.c 2006-10-20 10:17:54.000000000 +0100 +++ vino.orig/server/libvncserver/main.c 2006-10-20 10:17:54.000000000 +0100 @@ -34,10 +34,6 @@ #include #include -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD -MUTEX(logMutex); -#endif - int rfbEnableLogging=1; #ifdef WORDS_BIGENDIAN @@ -130,9 +126,6 @@ void rfbScheduleCopyRegion(rfbScreenInfo #if 0 /* TODO: is this needed? Or does it mess up deferring? */ /* while(!sraRgnEmpty(cl->copyRegion)) */ { -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD - if(!cl->screen->backgroundLoop) -#endif { sraRegionPtr updateRegion = sraRgnCreateRgn(cl->modifiedRegion); sraRgnOr(updateRegion,cl->copyRegion); @@ -146,7 +139,6 @@ void rfbScheduleCopyRegion(rfbScreenInfo } else { sraRgnOr(cl->modifiedRegion,copyRegion); } - TSIGNAL(cl->updateCond); UNLOCK(cl->updateMutex); } @@ -202,7 +194,6 @@ void rfbMarkRegionAsModified(rfbScreenIn while((cl=rfbClientIteratorNext(iterator))) { LOCK(cl->updateMutex); sraRgnOr(cl->modifiedRegion,modRegion); - TSIGNAL(cl->updateCond); UNLOCK(cl->updateMutex); } @@ -229,131 +220,6 @@ void rfbMarkRectAsModified(rfbScreenInfo sraRgnDestroy(region); } -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD -static void * -clientOutput(void *data) -{ - rfbClientPtr cl = (rfbClientPtr)data; - rfbBool haveUpdate; - sraRegion* updateRegion; - - while (1) { - haveUpdate = false; - while (!haveUpdate) { - if (cl->sock == -1) { - /* Client has disconnected. */ - return NULL; - } - LOCK(cl->updateMutex); - haveUpdate = FB_UPDATE_PENDING(cl); - if(!haveUpdate) { - updateRegion = sraRgnCreateRgn(cl->modifiedRegion); - haveUpdate = sraRgnAnd(updateRegion,cl->requestedRegion); - sraRgnDestroy(updateRegion); - } - UNLOCK(cl->updateMutex); - - if (!haveUpdate) { - WAIT(cl->updateCond, cl->updateMutex); - UNLOCK(cl->updateMutex); /* we really needn't lock now. */ - } - } - - /* OK, now, to save bandwidth, wait a little while for more - updates to come along. */ - usleep(cl->screen->rfbDeferUpdateTime * 1000); - - /* Now, get the region we're going to update, and remove - it from cl->modifiedRegion _before_ we send the update. - That way, if anything that overlaps the region we're sending - is updated, we'll be sure to do another update later. */ - LOCK(cl->updateMutex); - updateRegion = sraRgnCreateRgn(cl->modifiedRegion); - UNLOCK(cl->updateMutex); - - /* Now actually send the update. */ - rfbIncrClientRef(cl); - rfbSendFramebufferUpdate(cl, updateRegion); - rfbDecrClientRef(cl); - - sraRgnDestroy(updateRegion); - } - - return NULL; -} - -static void * -clientInput(void *data) -{ - rfbClientPtr cl = (rfbClientPtr)data; - pthread_t output_thread; - pthread_create(&output_thread, NULL, clientOutput, (void *)cl); - - while (1) { - rfbProcessClientMessage(cl); - if (cl->sock == -1) { - /* Client has disconnected. */ - break; - } - } - - /* Get rid of the output thread. */ - LOCK(cl->updateMutex); - TSIGNAL(cl->updateCond); - UNLOCK(cl->updateMutex); - IF_PTHREADS(pthread_join(output_thread, NULL)); - - rfbClientConnectionGone(cl); - - return NULL; -} - -static void* -listenerRun(void *data) -{ - rfbScreenInfoPtr rfbScreen=(rfbScreenInfoPtr)data; - int client_fd; - struct sockaddr_in peer; - rfbClientPtr cl; - size_t len; - - len = sizeof(peer); - - /* TODO: this thread wont die by restarting the server */ - while ((client_fd = accept(rfbScreen->rfbListenSock, - (struct sockaddr*)&peer, &len)) >= 0) { - cl = rfbNewClient(rfbScreen,client_fd); - len = sizeof(peer); - - if (cl && !cl->onHold ) - rfbStartOnHoldClient(cl); - } - return(NULL); -} - -void -rfbStartOnHoldClient(rfbClientPtr cl) -{ - pthread_create(&cl->client_thread, NULL, clientInput, (void *)cl); -} - -#else - -void -rfbStartOnHoldClient(rfbClientPtr cl) -{ - cl->onHold = FALSE; -} - -#endif - -void -rfbRefuseOnHoldClient(rfbClientPtr cl) -{ - rfbCloseClient(cl); - rfbClientConnectionGone(cl); -} - void defaultPtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl) { @@ -441,8 +307,6 @@ rfbScreenInfoPtr rfbGetScreen(int* argc, { rfbScreenInfoPtr rfbScreen=malloc(sizeof(rfbScreenInfo)); - INIT_MUTEX(logMutex); - if(width&3) rfbErr("WARNING: Width (%d) is not a multiple of 4. VncViewer has problems with that.\n",width); @@ -493,9 +357,6 @@ rfbScreenInfoPtr rfbGetScreen(int* argc, rfbScreen->cursorX=rfbScreen->cursorY=rfbScreen->underCursorBufferLen=0; rfbScreen->underCursorBuffer=NULL; rfbScreen->cursor = &myCursor; - INIT_MUTEX(rfbScreen->cursorMutex); - - IF_PTHREADS(rfbScreen->backgroundLoop = FALSE); rfbScreen->rfbDeferUpdateTime=5; rfbScreen->maxRectsPerUpdate=50; @@ -563,7 +424,6 @@ void rfbNewFramebuffer(rfbScreenInfoPtr if (cl->useNewFBSize) cl->newFBSizePending = TRUE; - TSIGNAL(cl->updateCond); UNLOCK(cl->updateMutex); } rfbReleaseClientIterator(iterator); @@ -586,7 +446,6 @@ void rfbScreenCleanup(rfbScreenInfoPtr r #define FREE_IF(x) if(rfbScreen->x) free(rfbScreen->x) FREE_IF(colourMap.data.bytes); FREE_IF(underCursorBuffer); - TINI_MUTEX(rfbScreen->cursorMutex); if(rfbScreen->cursor) rfbFreeCursor(rfbScreen->cursor); free(rfbScreen); @@ -670,17 +529,8 @@ rfbProcessEvents(rfbScreenInfoPtr rfbScr void rfbRunEventLoop(rfbScreenInfoPtr rfbScreen, long usec, rfbBool runInBackground) { if(runInBackground) { -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD - pthread_t listener_thread; - - rfbScreen->backgroundLoop = TRUE; - - pthread_create(&listener_thread, NULL, listenerRun, rfbScreen); - return; -#else rfbErr("Can't run in background, because I don't have PThreads!\n"); return; -#endif } if(usec<0) Index: vino/server/libvncserver/rfbserver.c =================================================================== --- vino.orig/server/libvncserver/rfbserver.c 2006-10-20 10:17:54.000000000 +0100 +++ vino.orig/server/libvncserver/rfbserver.c 2006-10-20 10:17:54.000000000 +0100 @@ -61,31 +61,6 @@ rfbClientPtr pointerClient = NULL; /* M static void rfbProcessClientProtocolVersion(rfbClientPtr cl); static void rfbProcessClientNormalMessage(rfbClientPtr cl); -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD -void rfbIncrClientRef(rfbClientPtr cl) -{ - LOCK(cl->refCountMutex); - cl->refCount++; - UNLOCK(cl->refCountMutex); -} - -void rfbDecrClientRef(rfbClientPtr cl) -{ - LOCK(cl->refCountMutex); - cl->refCount--; - if(cl->refCount<=0) /* just to be sure also < 0 */ - TSIGNAL(cl->deleteCond); - UNLOCK(cl->refCountMutex); -} -#else -void rfbIncrClientRef(rfbClientPtr cl) {} -void rfbDecrClientRef(rfbClientPtr cl) {} -#endif - -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD -MUTEX(rfbClientListMutex); -#endif - struct rfbClientIterator { rfbClientPtr next; rfbScreenInfoPtr screen; @@ -101,7 +76,6 @@ rfbClientListInit(rfbScreenInfoPtr rfbSc exit(1); } rfbScreen->rfbClientHead = NULL; - INIT_MUTEX(rfbClientListMutex); } rfbClientIteratorPtr @@ -117,12 +91,6 @@ rfbGetClientIterator(rfbScreenInfoPtr rf rfbClientPtr rfbClientIteratorHead(rfbClientIteratorPtr i) { -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD - if(i->next != 0) { - rfbDecrClientRef(i->next); - rfbIncrClientRef(i->screen->rfbClientHead); - } -#endif LOCK(rfbClientListMutex); i->next = i->screen->rfbClientHead; UNLOCK(rfbClientListMutex); @@ -137,25 +105,15 @@ rfbClientIteratorNext(rfbClientIteratorP i->next = i->screen->rfbClientHead; UNLOCK(rfbClientListMutex); } else { - IF_PTHREADS(rfbClientPtr cl = i->next); i->next = i->next->next; - IF_PTHREADS(rfbDecrClientRef(cl)); } -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD - while(i->next && i->next->sock<0) - i->next = i->next->next; - if(i->next) - rfbIncrClientRef(i->next); -#endif - return i->next; } void rfbReleaseClientIterator(rfbClientIteratorPtr iterator) { - IF_PTHREADS(if(iterator->next) rfbDecrClientRef(iterator->next)); free(iterator); } @@ -230,10 +188,6 @@ rfbNewClient(rfbScreenInfoPtr rfbScreen, FD_SET(sock,&(rfbScreen->allFds)); rfbScreen->maxFd = max(sock,rfbScreen->maxFd); - INIT_MUTEX(cl->outputMutex); - INIT_MUTEX(cl->refCountMutex); - INIT_COND(cl->deleteCond); - cl->state = RFB_PROTOCOL_VERSION; cl->readyForSetColourMapEntries = FALSE; @@ -252,9 +206,6 @@ rfbNewClient(rfbScreenInfoPtr rfbScreen, cl->modifiedRegion = sraRgnCreateRect(0,0,rfbScreen->width,rfbScreen->height); - INIT_MUTEX(cl->updateMutex); - INIT_COND(cl->updateCond); - cl->requestedRegion = sraRgnCreate(); cl->format = cl->screen->rfbServerFormat; @@ -263,7 +214,6 @@ rfbNewClient(rfbScreenInfoPtr rfbScreen, LOCK(rfbClientListMutex); - IF_PTHREADS(cl->refCount = 0); cl->next = rfbScreen->rfbClientHead; cl->prev = NULL; if (rfbScreen->rfbClientHead) @@ -353,17 +303,6 @@ rfbClientConnectionGone(rfbClientPtr cl) FreeZrleData(cl); #endif -#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD - if(cl->screen->backgroundLoop != FALSE) - do { - LOCK(cl->refCountMutex); - i=cl->refCount; - UNLOCK(cl->refCountMutex); - if(i>0) - WAIT(cl->deleteCond,cl->refCountMutex); - } while(i>0); -#endif - if(cl->sock>=0) FD_CLR(cl->sock,&(cl->screen->allFds)); @@ -398,14 +337,6 @@ rfbClientConnectionGone(rfbClientPtr cl) if (cl->translateLookupTable) free(cl->translateLookupTable); - TINI_COND(cl->updateCond); - TINI_MUTEX(cl->updateMutex); - - /* make sure outputMutex is unlocked before destroying */ - LOCK(cl->outputMutex); - UNLOCK(cl->outputMutex); - TINI_MUTEX(cl->outputMutex); - rfbPrintStats(cl); free(cl); @@ -831,7 +762,6 @@ rfbProcessClientNormalMessage(rfbClientP sraRgnOr(cl->modifiedRegion,tmpRegion); sraRgnSubtract(cl->copyRegion,tmpRegion); } - TSIGNAL(cl->updateCond); UNLOCK(cl->updateMutex); sraRgnDestroy(tmpRegion);