Commit f40b0111 authored by runge's avatar runge

Add locks of updateMutex in rfbRedrawAfterHideCursor() and

rfbSetClientColourMap().  Up listen limit from 5 to 32.
parent a8453eea
...@@ -693,10 +693,13 @@ void rfbRedrawAfterHideCursor(rfbClientPtr cl,sraRegionPtr updateRegion) ...@@ -693,10 +693,13 @@ void rfbRedrawAfterHideCursor(rfbClientPtr cl,sraRegionPtr updateRegion)
if(sraClipRect2(&x,&y,&x2,&y2,0,0,s->width,s->height)) { if(sraClipRect2(&x,&y,&x2,&y2,0,0,s->width,s->height)) {
sraRegionPtr rect; sraRegionPtr rect;
rect = sraRgnCreateRect(x,y,x2,y2); rect = sraRgnCreateRect(x,y,x2,y2);
if(updateRegion) if(updateRegion) {
sraRgnOr(updateRegion,rect); sraRgnOr(updateRegion,rect);
else } else {
LOCK(cl->updateMutex);
sraRgnOr(cl->modifiedRegion,rect); sraRgnOr(cl->modifiedRegion,rect);
UNLOCK(cl->updateMutex);
}
sraRgnDestroy(rect); sraRgnDestroy(rect);
} }
} }
......
...@@ -638,7 +638,7 @@ rfbListenOnTCPPort(int port, ...@@ -638,7 +638,7 @@ rfbListenOnTCPPort(int port,
closesocket(sock); closesocket(sock);
return -1; return -1;
} }
if (listen(sock, 5) < 0) { if (listen(sock, 32) < 0) {
closesocket(sock); closesocket(sock);
return -1; return -1;
} }
......
...@@ -423,6 +423,7 @@ rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours) ...@@ -423,6 +423,7 @@ rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours)
} }
if (cl->format.trueColour) { if (cl->format.trueColour) {
LOCK(cl->updateMutex);
(*rfbInitColourMapSingleTableFns (*rfbInitColourMapSingleTableFns
[BPP2OFFSET(cl->format.bitsPerPixel)]) (&cl->translateLookupTable, [BPP2OFFSET(cl->format.bitsPerPixel)]) (&cl->translateLookupTable,
&cl->screen->serverFormat, &cl->format,&cl->screen->colourMap); &cl->screen->serverFormat, &cl->format,&cl->screen->colourMap);
...@@ -430,6 +431,7 @@ rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours) ...@@ -430,6 +431,7 @@ rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours)
sraRgnDestroy(cl->modifiedRegion); sraRgnDestroy(cl->modifiedRegion);
cl->modifiedRegion = cl->modifiedRegion =
sraRgnCreateRect(0,0,cl->screen->width,cl->screen->height); sraRgnCreateRect(0,0,cl->screen->width,cl->screen->height);
UNLOCK(cl->updateMutex);
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment