From: Pierre Ossman Date: Thu, 19 Jan 2017 14:23:05 +0000 (+0100) Subject: Harmonise new client handlers X-Git-Tag: v1.7.90~50 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4b35524594d31349c8aaa81593b1be1b1bf4ef4f;p=tigervnc.git Harmonise new client handlers One was missing a call to register the fd with the X server, and one forgot to set it to non-blocking. One result of this was a crash when hitting the blacklist. --- diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index f6e6a7fe..1428791e 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -443,6 +443,7 @@ bool XserverDesktop::handleListenerEvent(int fd, sock->outStream().setBlocking(false); vlog.debug("new client, sock %d", sock->getFd()); sockserv->addSocket(sock); + vncSetNotifyFd(sock->getFd(), screenIndex, true, false); return true; } @@ -536,6 +537,7 @@ void XserverDesktop::blockHandler(int* timeout) void XserverDesktop::addClient(Socket* sock, bool reverse) { vlog.debug("new client, sock %d reverse %d",sock->getFd(),reverse); + sock->outStream().setBlocking(false); server->addSocket(sock, reverse); vncSetNotifyFd(sock->getFd(), screenIndex, true, false); }