mirror of
https://github.com/KDE/krfb
synced 2026-07-01 07:41:17 -07:00
commit with deadlock probs
svn path=/trunk/kdenetwork/krfb/; revision=136246
This commit is contained in:
26
kinetd/Makefile.am
Normal file
26
kinetd/Makefile.am
Normal file
@@ -0,0 +1,26 @@
|
||||
METASOURCES = AUTO
|
||||
|
||||
# Code
|
||||
noinst_LIBRARIES = kinetd.a
|
||||
|
||||
kinetd_a_SOURCES = kinetd.cpp
|
||||
kinetd_a_LDADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI)
|
||||
|
||||
# Services
|
||||
kdedir = $(kde_servicesdir)/kded
|
||||
kde_DATA = kdeprintd.desktop
|
||||
|
||||
|
||||
EXTRA_DIST = $(krfb_SOURCES) $(kde_DATA) kinetd.h
|
||||
|
||||
|
||||
KDE_ICON = kinetd
|
||||
|
||||
# set the include path for X, qt and KDE
|
||||
INCLUDES= $(all_includes)
|
||||
|
||||
# the library search path.
|
||||
kinetd_a_LDFLAGS = $(all_libraries) $(KDE_RPATH)
|
||||
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
|
||||
@@ -53,17 +53,17 @@ XUpdateScanner::XUpdateScanner(Display *_dpy,
|
||||
int _bytesPerLine,
|
||||
unsigned int _tileWidth,
|
||||
unsigned int _tileHeight) :
|
||||
dpy(_dpy),
|
||||
dpy(_dpy),
|
||||
window(_window),
|
||||
fb(_fb),
|
||||
fb(_fb),
|
||||
width(_width),
|
||||
height(_height),
|
||||
bitsPerPixel(_bitsPerPixel),
|
||||
bytesPerLine(_bytesPerLine),
|
||||
tileWidth(_tileWidth),
|
||||
tileHeight(_tileHeight),
|
||||
count (0),
|
||||
scanline(NULL),
|
||||
tileWidth(_tileWidth),
|
||||
tileHeight(_tileHeight),
|
||||
count (0),
|
||||
scanline(NULL),
|
||||
tile(NULL)
|
||||
{
|
||||
tile = XShmCreateImage(dpy,
|
||||
@@ -74,20 +74,20 @@ XUpdateScanner::XUpdateScanner(Display *_dpy,
|
||||
&shminfo_tile,
|
||||
tileWidth,
|
||||
tileHeight);
|
||||
|
||||
|
||||
shminfo_tile.shmid = shmget(IPC_PRIVATE,
|
||||
tile->bytes_per_line * tile->height,
|
||||
IPC_CREAT | 0777);
|
||||
shminfo_tile.shmaddr = tile->data = (char *)
|
||||
shmat(shminfo_tile.shmid, 0, 0);
|
||||
shminfo_tile.readOnly = False;
|
||||
|
||||
|
||||
XShmAttach(dpy, &shminfo_tile);
|
||||
|
||||
tilesX = (width + tileWidth - 1) / tileWidth;
|
||||
tilesY = (height + tileHeight - 1) / tileHeight;
|
||||
tileMap = new bool[tilesX * tilesY];
|
||||
|
||||
|
||||
unsigned int i;
|
||||
for (i = 0; i < tilesX * tilesY; i++)
|
||||
tileMap[i] = false;
|
||||
@@ -100,14 +100,14 @@ XUpdateScanner::XUpdateScanner(Display *_dpy,
|
||||
&shminfo_scanline,
|
||||
width,
|
||||
1);
|
||||
|
||||
|
||||
shminfo_scanline.shmid = shmget(IPC_PRIVATE,
|
||||
scanline->bytes_per_line,
|
||||
IPC_CREAT | 0777);
|
||||
shminfo_scanline.shmaddr = scanline->data = (char *)
|
||||
shmat( shminfo_scanline.shmid, 0, 0 );
|
||||
shminfo_scanline.readOnly = False;
|
||||
|
||||
|
||||
XShmAttach(dpy, &shminfo_scanline);
|
||||
};
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include <X11/extensions/XTest.h>
|
||||
|
||||
#define VERSION "0.6"
|
||||
|
||||
static const char *description = I18N_NOOP("VNC-compatible server to share "
|
||||
@@ -61,26 +59,6 @@ static KCmdLineOptions options[] =
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
|
||||
static int checkX11Capabilities() {
|
||||
int bp1, bp2, majorv, minorv;
|
||||
Bool r = XTestQueryExtension(qt_xdisplay(), &bp1, &bp2,
|
||||
&majorv, &minorv);
|
||||
if ((!r) || (((majorv*1000)+minorv) < 2002)) {
|
||||
KMessageBox::error(0,
|
||||
i18n("Your X11 Server does not support the required XTest extension version 2.2. Sharing your desktop is not possible."),
|
||||
i18n("Desktop Sharing Error"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
r = XShmQueryExtension(qt_xdisplay());
|
||||
if (!r) {
|
||||
KMessageBox::error(0,
|
||||
i18n("Your X11 Server does not support the required XShm extension. You can only share a local desktop."),
|
||||
i18n("Desktop Sharing Error"));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -114,8 +92,8 @@ int main(int argc, char *argv[])
|
||||
KCmdLineArgs::addCmdLineOptions(options);
|
||||
|
||||
KApplication app;
|
||||
if ((r = checkX11Capabilities()) != 0)
|
||||
return r;
|
||||
if (!RFBController::checkX11Capabilities())
|
||||
return 1;
|
||||
|
||||
Configuration *config;
|
||||
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
|
||||
@@ -137,7 +115,8 @@ int main(int argc, char *argv[])
|
||||
config = new Configuration();
|
||||
args->clear();
|
||||
|
||||
TrayIcon trayicon(new KAboutApplication(&aboutData), config);
|
||||
TrayIcon trayicon(new KAboutApplication(&aboutData),
|
||||
config);
|
||||
RFBController controller(config);
|
||||
|
||||
QObject::connect(&app, SIGNAL(lastWindowClosed()),
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <qpushbutton.h>
|
||||
#include <qglobal.h>
|
||||
#include <qlabel.h>
|
||||
#include <qmutex.h>
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/extensions/XTest.h>
|
||||
@@ -60,21 +61,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static void keyboardHook(Bool down, KeySym keySym, rfbClientPtr)
|
||||
{
|
||||
AppLocker a;
|
||||
self->handleKeyEvent(down?true:false, keySym);
|
||||
}
|
||||
|
||||
static void pointerHook(int bm, int x, int y, rfbClientPtr)
|
||||
{
|
||||
AppLocker a;
|
||||
self->handlePointerEvent(bm, x, y);
|
||||
}
|
||||
|
||||
static enum rfbNewClientAction newClientHook(struct _rfbClientRec *cl)
|
||||
{
|
||||
AppLocker a;
|
||||
return self->handleNewClient(cl);
|
||||
}
|
||||
|
||||
@@ -86,8 +74,23 @@ static Bool passwordCheck(rfbClientPtr cl,
|
||||
self->handleCheckPassword(encryptedPassword, len);
|
||||
}
|
||||
|
||||
static void keyboardHook(Bool down, KeySym keySym, rfbClientPtr)
|
||||
{
|
||||
// todo!
|
||||
AppLocker a;
|
||||
self->handleKeyEvent(down?true:false, keySym);
|
||||
}
|
||||
|
||||
static void pointerHook(int bm, int x, int y, rfbClientPtr)
|
||||
{
|
||||
// todo!
|
||||
AppLocker a;
|
||||
self->handlePointerEvent(bm, x, y);
|
||||
}
|
||||
|
||||
static void clientGoneHook(rfbClientPtr cl)
|
||||
{
|
||||
// todo!
|
||||
AppLocker a;
|
||||
self->handleClientGone();
|
||||
}
|
||||
@@ -136,40 +139,45 @@ void RFBController::startServer(bool xtestGrab)
|
||||
|
||||
int w = framebufferImage->width;
|
||||
int h = framebufferImage->height;
|
||||
int bpp = framebufferImage->depth;
|
||||
char *fb = framebufferImage->data;
|
||||
|
||||
int red_max, green_max, blue_max;
|
||||
int red_shift, green_shift, blue_shift;
|
||||
|
||||
if (bpp == 8) {
|
||||
red_max = 3;
|
||||
green_max = 7;
|
||||
blue_max = 3;
|
||||
red_shift = 0;
|
||||
green_shift = 2;
|
||||
blue_shift = 5;
|
||||
server = rfbGetScreen(0, 0, w, h,
|
||||
framebufferImage->bits_per_pixel,
|
||||
8,
|
||||
framebufferImage->bits_per_pixel/8);
|
||||
|
||||
server->paddedWidthInBytes = framebufferImage->bytes_per_line;
|
||||
|
||||
server->rfbServerFormat.bitsPerPixel = framebufferImage->bits_per_pixel;
|
||||
server->rfbServerFormat.depth = framebufferImage->depth;
|
||||
//rfbEndianTest = framebufferImage->bitmap_bit_order != MSBFirst;
|
||||
server->rfbServerFormat.trueColour = TRUE;
|
||||
|
||||
if ( server->rfbServerFormat.bitsPerPixel == 8 ) {
|
||||
server->rfbServerFormat.redShift = 0;
|
||||
server->rfbServerFormat.greenShift = 2;
|
||||
server->rfbServerFormat.blueShift = 5;
|
||||
server->rfbServerFormat.redMax = 3;
|
||||
server->rfbServerFormat.greenMax = 7;
|
||||
server->rfbServerFormat.blueMax = 3;
|
||||
} else {
|
||||
red_shift = 0;
|
||||
server->rfbServerFormat.redShift = 0;
|
||||
if ( framebufferImage->red_mask )
|
||||
while (!(framebufferImage->red_mask & (1 << red_shift)))
|
||||
red_shift++;
|
||||
green_shift = 0;
|
||||
if (framebufferImage->green_mask)
|
||||
while (!(framebufferImage->green_mask & (1 << green_shift)))
|
||||
green_shift++;
|
||||
blue_shift = 0;
|
||||
if (framebufferImage->blue_mask)
|
||||
while (!(framebufferImage->blue_mask & (1 << blue_shift)))
|
||||
blue_shift++;
|
||||
red_max = framebufferImage->red_mask >> red_shift;
|
||||
green_max = framebufferImage->green_mask >> green_shift;
|
||||
blue_max = framebufferImage->blue_mask >> blue_shift;
|
||||
while ( ! ( framebufferImage->red_mask & (1 << server->rfbServerFormat.redShift) ) )
|
||||
server->rfbServerFormat.redShift++;
|
||||
server->rfbServerFormat.greenShift = 0;
|
||||
if ( framebufferImage->green_mask )
|
||||
while ( ! ( framebufferImage->green_mask & (1 << server->rfbServerFormat.greenShift) ) )
|
||||
server->rfbServerFormat.greenShift++;
|
||||
server->rfbServerFormat.blueShift = 0;
|
||||
if ( framebufferImage->blue_mask )
|
||||
while ( ! ( framebufferImage->blue_mask & (1 << server->rfbServerFormat.blueShift) ) )
|
||||
server->rfbServerFormat.blueShift++;
|
||||
server->rfbServerFormat.redMax = framebufferImage->red_mask >> server->rfbServerFormat.redShift;
|
||||
server->rfbServerFormat.greenMax = framebufferImage->green_mask >> server->rfbServerFormat.greenShift;
|
||||
server->rfbServerFormat.blueMax = framebufferImage->blue_mask >> server->rfbServerFormat.blueShift;
|
||||
}
|
||||
|
||||
server = rfbGetScreen2(0, 0, w, h, bpp/8,
|
||||
red_max, green_max, blue_max,
|
||||
red_shift, green_shift, blue_shift);
|
||||
server->frameBuffer = fb;
|
||||
server->rfbPort = configuration->port();
|
||||
//server->udpPort = configuration->port();
|
||||
@@ -181,8 +189,9 @@ void RFBController::startServer(bool xtestGrab)
|
||||
|
||||
scanner = new XUpdateScanner(qt_xdisplay(),
|
||||
QApplication::desktop()->winId(),
|
||||
(unsigned char*)fb,
|
||||
w, h, bpp, (bpp/8)*w);
|
||||
(unsigned char*)fb, w, h,
|
||||
server->rfbServerFormat.bitsPerPixel,
|
||||
server->paddedWidthInBytes);
|
||||
|
||||
rfbInitServer(server);
|
||||
state = RFB_WAITING;
|
||||
@@ -267,6 +276,9 @@ void RFBController::closeConnection()
|
||||
|
||||
void RFBController::idleSlot()
|
||||
{
|
||||
if (state != RFB_CONNECTED)
|
||||
return;
|
||||
|
||||
rfbUndrawCursor(server);
|
||||
|
||||
QList<Hint> v;
|
||||
@@ -313,7 +325,6 @@ enum rfbNewClientAction RFBController::handleNewClient(rfbClientPtr cl)
|
||||
return RFB_CLIENT_REFUSE;
|
||||
|
||||
client = cl;
|
||||
|
||||
state = RFB_CONNECTING;
|
||||
|
||||
if (!configuration->askOnConnect()) {
|
||||
@@ -321,11 +332,13 @@ enum rfbNewClientAction RFBController::handleNewClient(rfbClientPtr cl)
|
||||
return RFB_CLIENT_ACCEPT;
|
||||
}
|
||||
|
||||
QString host, port;
|
||||
KExtendedSocket::resolve(KExtendedSocket::peerAddress(socket),
|
||||
host, port);
|
||||
dialog.ipLabel->setText(host);
|
||||
dialog.allowRemoteControlCB->setChecked(configuration->allowDesktopControl());
|
||||
// TODO: get & set client host name
|
||||
|
||||
dialog.setFixedSize(dialog.sizeHint());
|
||||
dialog.show();
|
||||
|
||||
return RFB_CLIENT_ON_HOLD;
|
||||
}
|
||||
|
||||
@@ -448,6 +461,27 @@ void RFBController::handlePointerEvent(int button_mask, int x, int y) {
|
||||
buttonMask = button_mask;
|
||||
}
|
||||
|
||||
bool RFBController::checkX11Capabilities() {
|
||||
int bp1, bp2, majorv, minorv;
|
||||
Bool r = XTestQueryExtension(qt_xdisplay(), &bp1, &bp2,
|
||||
&majorv, &minorv);
|
||||
if ((!r) || (((majorv*1000)+minorv) < 2002)) {
|
||||
KMessageBox::error(0,
|
||||
i18n("Your X11 Server does not support the required XTest extension version 2.2. Sharing your desktop is not possible."),
|
||||
i18n("Desktop Sharing Error"));
|
||||
return false;
|
||||
}
|
||||
|
||||
r = XShmQueryExtension(qt_xdisplay());
|
||||
if (!r) {
|
||||
KMessageBox::error(0,
|
||||
i18n("Your X11 Server does not support the required XShm extension. You can only share a local desktop."),
|
||||
i18n("Desktop Sharing Error"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
XTestDisabler::XTestDisabler() :
|
||||
disable(false) {
|
||||
|
||||
@@ -82,6 +82,8 @@ public:
|
||||
enum rfbNewClientAction handleNewClient(rfbClientPtr cl);
|
||||
void handleClientGone();
|
||||
|
||||
static bool checkX11Capabilities();
|
||||
|
||||
public slots:
|
||||
void rebind();
|
||||
void closeConnection();
|
||||
|
||||
@@ -25,30 +25,33 @@
|
||||
#include <kpopupmenu.h>
|
||||
|
||||
TrayIcon::TrayIcon(KDialog *d, Configuration *c) :
|
||||
KSystemTray(),
|
||||
aboutDialog(d)
|
||||
KSystemTray(0, "krfb trayicon"),
|
||||
aboutDialog(d),
|
||||
actionCollection(this)
|
||||
{
|
||||
KIconLoader *loader = KGlobal::iconLoader();
|
||||
trayIconOpen = loader->loadIcon("eyes-open24", KIcon::User);
|
||||
trayIconClosed = loader->loadIcon("eyes-closed24", KIcon::User);
|
||||
setPixmap(trayIconClosed);
|
||||
|
||||
configureAction = KStdAction::preferences();
|
||||
configureAction = KStdAction::preferences(0, 0, &actionCollection);
|
||||
if (!c->preconfigured())
|
||||
configureAction->plug(contextMenu());
|
||||
|
||||
closeConnectionAction = new KAction(i18n("Close connection"));
|
||||
closeConnectionAction->plug(contextMenu());
|
||||
closeConnectionAction->setEnabled(false);
|
||||
actionCollection.insert(closeConnectionAction);
|
||||
|
||||
contextMenu()->insertSeparator();
|
||||
aboutAction = KStdAction::aboutApp();
|
||||
aboutAction = KStdAction::aboutApp(0, 0, &actionCollection);
|
||||
aboutAction->plug(contextMenu());
|
||||
|
||||
connect(configureAction, SIGNAL(activated()), SIGNAL(showConfigure()));
|
||||
connect(aboutAction, SIGNAL(activated()), SLOT(showAbout()));
|
||||
connect(closeConnectionAction, SIGNAL(activated()),
|
||||
SIGNAL(connectionClosed()));
|
||||
actionCollection.insert(closeConnectionAction);
|
||||
show();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ private:
|
||||
KPixmap trayIconOpen;
|
||||
KPixmap trayIconClosed;
|
||||
KDialog* aboutDialog;
|
||||
KActionCollection actionCollection;
|
||||
KAction* closeConnectionAction;
|
||||
KAction* configureAction;
|
||||
KAction* aboutAction;
|
||||
|
||||
@@ -296,7 +296,6 @@ listenerRun(void *data)
|
||||
rfbScreenInfoPtr rfbScreen=(rfbScreenInfoPtr)data;
|
||||
int client_fd;
|
||||
struct sockaddr_in peer;
|
||||
pthread_t client_thread;
|
||||
rfbClientPtr cl;
|
||||
int len;
|
||||
|
||||
@@ -305,7 +304,6 @@ listenerRun(void *data)
|
||||
(struct sockaddr*)&peer, &len)) >= 0) {
|
||||
cl = rfbNewClient(rfbScreen,client_fd);
|
||||
len = sizeof(peer);
|
||||
cl->client_thread = &client_thread;
|
||||
|
||||
if (cl && !cl->onHold )
|
||||
rfbStartOnHoldClient(cl);
|
||||
@@ -318,7 +316,7 @@ listenerRun(void *data)
|
||||
void
|
||||
rfbStartOnHoldClient(rfbClientPtr cl)
|
||||
{
|
||||
pthread_create(cl->client_thread, NULL, clientInput, (void *)cl);
|
||||
pthread_create(&cl->client_thread, NULL, clientInput, (void *)cl);
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -455,30 +453,6 @@ enum rfbNewClientAction defaultNewClientHook(rfbClientPtr cl)
|
||||
rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
|
||||
int width,int height,int bitsPerSample,int samplesPerPixel,
|
||||
int bytesPerPixel)
|
||||
{
|
||||
if(bytesPerPixel == 1) {
|
||||
return rfbGetScreen2(argc, argv, width, height, bytesPerPixel,
|
||||
7, 7, 3, 0, 3, 6);
|
||||
} else {
|
||||
int redMax = (1 << bitsPerSample) - 1;
|
||||
int greenMax = (1 << bitsPerSample) - 1;
|
||||
int blueMax = (1 << bitsPerSample) - 1;
|
||||
if(rfbEndianTest) {
|
||||
return rfbGetScreen2(argc, argv, width, height, bytesPerPixel,
|
||||
redMax, greenMax, blueMax,
|
||||
0, bitsPerSample, bitsPerSample * 2);
|
||||
} else {
|
||||
return rfbGetScreen2(argc, argv, width, height, bytesPerPixel,
|
||||
redMax, greenMax, blueMax,
|
||||
bitsPerSample*3, bitsPerSample*2, bitsPerSample);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rfbScreenInfoPtr rfbGetScreen2(int* argc,char** argv,
|
||||
int width,int height,int bytesPerPixel,
|
||||
int redMax, int greenMax, int blueMax,
|
||||
int redShift, int greenShift, int blueShift)
|
||||
{
|
||||
rfbScreenInfoPtr rfbScreen=malloc(sizeof(rfbScreenInfo));
|
||||
rfbPixelFormat* format=&rfbScreen->rfbServerFormat;
|
||||
@@ -545,12 +519,27 @@ rfbScreenInfoPtr rfbGetScreen2(int* argc,char** argv,
|
||||
rfbScreen->colourMap.is16 = 0;
|
||||
rfbScreen->colourMap.data.bytes = NULL;
|
||||
|
||||
format->redMax = redMax;
|
||||
format->greenMax = greenMax;
|
||||
format->blueMax = blueMax;
|
||||
format->redShift = redShift;
|
||||
format->greenShift = greenShift;
|
||||
format->blueShift = blueShift;
|
||||
if(bytesPerPixel == 1) {
|
||||
format->redMax = 7;
|
||||
format->greenMax = 7;
|
||||
format->blueMax = 3;
|
||||
format->redShift = 0;
|
||||
format->greenShift = 3;
|
||||
format->blueShift = 6;
|
||||
} else {
|
||||
format->redMax = (1 << bitsPerSample) - 1;
|
||||
format->greenMax = (1 << bitsPerSample) - 1;
|
||||
format->blueMax = (1 << bitsPerSample) - 1;
|
||||
if(rfbEndianTest) {
|
||||
format->redShift = 0;
|
||||
format->greenShift = bitsPerSample;
|
||||
format->blueShift = bitsPerSample * 2;
|
||||
} else {
|
||||
format->redShift = bitsPerSample*3;
|
||||
format->greenShift = bitsPerSample*2;
|
||||
format->blueShift = bitsPerSample;
|
||||
}
|
||||
}
|
||||
|
||||
/* cursor */
|
||||
|
||||
|
||||
@@ -377,7 +377,7 @@ typedef struct _rfbClientRec {
|
||||
char *host;
|
||||
|
||||
#ifdef HAVE_PTHREADS
|
||||
pthread_t *client_thread;
|
||||
pthread_t client_thread;
|
||||
#endif
|
||||
/* Possible client states: */
|
||||
enum {
|
||||
@@ -778,10 +778,6 @@ Bool rfbCheckPasswordByList(rfbClientPtr cl,char* response,int len);
|
||||
extern rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
|
||||
int width,int height,int bitsPerSample,int samplesPerPixel,
|
||||
int bytesPerPixel);
|
||||
extern rfbScreenInfoPtr rfbGetScreen2(int* argc,char** argv,
|
||||
int width,int height,int bytesPerPixel,
|
||||
int redMax, int greenMax, int blueMax,
|
||||
int redShift, int greenShift, int blueShift);
|
||||
extern void rfbInitServer(rfbScreenInfoPtr rfbScreen);
|
||||
extern void rfbScreenCleanup(rfbScreenInfoPtr screenInfo);
|
||||
|
||||
|
||||
@@ -282,12 +282,12 @@ rfbNewTCPOrUDPClient(rfbScreen,sock,isUDP)
|
||||
cl->clientData = NULL;
|
||||
cl->clientGoneHook = doNothingWithClient;
|
||||
switch (cl->screen->newClientHook(cl)) {
|
||||
case RFB_CLIENT_ACCEPT:
|
||||
cl->onHold = FALSE;
|
||||
break;
|
||||
case RFB_CLIENT_ON_HOLD:
|
||||
cl->onHold = TRUE;
|
||||
break;
|
||||
case RFB_CLIENT_ACCEPT:
|
||||
cl->onHold = FALSE;
|
||||
break;
|
||||
case RFB_CLIENT_REFUSE:
|
||||
rfbCloseClient(cl);
|
||||
rfbClientConnectionGone(cl);
|
||||
|
||||
@@ -365,7 +365,7 @@ ReadExact(cl, buf, len)
|
||||
FD_SET(sock, &fds);
|
||||
tv.tv_sec = rfbMaxClientWait / 1000;
|
||||
tv.tv_usec = (rfbMaxClientWait % 1000) * 1000;
|
||||
n = select(sock+1, &fds, NULL, NULL, &tv);
|
||||
n = select(sock+1, &fds, NULL, &fds, &tv);
|
||||
if (n < 0) {
|
||||
rfbLogPerror("ReadExact: select");
|
||||
return n;
|
||||
|
||||
Reference in New Issue
Block a user