Commit 5ef5c81e authored by dscho's avatar dscho

fixed a bug when closing a client if no longer listening for new clients.

parent 8a5f8f25
...@@ -330,7 +330,8 @@ rfbCloseClient(cl) ...@@ -330,7 +330,8 @@ rfbCloseClient(cl)
{ {
FD_CLR(cl->sock,&(cl->screen->allFds)); FD_CLR(cl->sock,&(cl->screen->allFds));
if(cl->sock==cl->screen->maxFd) if(cl->sock==cl->screen->maxFd)
while(!FD_ISSET(cl->screen->maxFd,&(cl->screen->allFds))) while(cl->screen->maxFd>0
&& !FD_ISSET(cl->screen->maxFd,&(cl->screen->allFds)))
cl->screen->maxFd--; cl->screen->maxFd--;
shutdown(cl->sock,SHUT_RDWR); shutdown(cl->sock,SHUT_RDWR);
close(cl->sock); close(cl->sock);
......
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