summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrunge <runge@karlrunge.com>2009-12-01 20:58:47 -0500
committerrunge <runge@karlrunge.com>2009-12-01 20:58:47 -0500
commitf40b0111827677625d81b7b7fcd001ce285adf69 (patch)
tree85a8951b851ab5393cdac1d8a72e96abaf16435d
parenta8453eea8b0f0e5a2754582f369044fc01ef2d79 (diff)
downloadlibvncserver-f40b0111827677625d81b7b7fcd001ce285adf69.zip
libvncserver-f40b0111827677625d81b7b7fcd001ce285adf69.tar.gz
Add locks of updateMutex in rfbRedrawAfterHideCursor() and
rfbSetClientColourMap(). Up listen limit from 5 to 32.
-rw-r--r--libvncserver/cursor.c7
-rwxr-xr-xlibvncserver/sockets.c2
-rwxr-xr-xlibvncserver/translate.c2
3 files changed, 8 insertions, 3 deletions
diff --git a/libvncserver/cursor.c b/libvncserver/cursor.c
index 5e30017..c071dd9 100644
--- a/libvncserver/cursor.c
+++ b/libvncserver/cursor.c
@@ -693,10 +693,13 @@ void rfbRedrawAfterHideCursor(rfbClientPtr cl,sraRegionPtr updateRegion)
if(sraClipRect2(&x,&y,&x2,&y2,0,0,s->width,s->height)) {
sraRegionPtr rect;
rect = sraRgnCreateRect(x,y,x2,y2);
- if(updateRegion)
+ if(updateRegion) {
sraRgnOr(updateRegion,rect);
- else
+ } else {
+ LOCK(cl->updateMutex);
sraRgnOr(cl->modifiedRegion,rect);
+ UNLOCK(cl->updateMutex);
+ }
sraRgnDestroy(rect);
}
}
diff --git a/libvncserver/sockets.c b/libvncserver/sockets.c
index 0d04f0a..fa7ea92 100755
--- a/libvncserver/sockets.c
+++ b/libvncserver/sockets.c
@@ -638,7 +638,7 @@ rfbListenOnTCPPort(int port,
closesocket(sock);
return -1;
}
- if (listen(sock, 5) < 0) {
+ if (listen(sock, 32) < 0) {
closesocket(sock);
return -1;
}
diff --git a/libvncserver/translate.c b/libvncserver/translate.c
index 500d47d..7c341c2 100755
--- a/libvncserver/translate.c
+++ b/libvncserver/translate.c
@@ -423,6 +423,7 @@ rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours)
}
if (cl->format.trueColour) {
+ LOCK(cl->updateMutex);
(*rfbInitColourMapSingleTableFns
[BPP2OFFSET(cl->format.bitsPerPixel)]) (&cl->translateLookupTable,
&cl->screen->serverFormat, &cl->format,&cl->screen->colourMap);
@@ -430,6 +431,7 @@ rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours)
sraRgnDestroy(cl->modifiedRegion);
cl->modifiedRegion =
sraRgnCreateRect(0,0,cl->screen->width,cl->screen->height);
+ UNLOCK(cl->updateMutex);
return TRUE;
}
OpenPOWER on IntegriCloud