summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
-rw-r--r--common/lzoconf.h3
-rw-r--r--common/lzodefs.h2
-rw-r--r--libvncclient/sasl.c4
l---------libvncserver/main.cc1
-rw-r--r--libvncserver/main.cpp (renamed from libvncserver/main.c)69
-rw-r--r--libvncserver/main.h30
-rw-r--r--webclients/novnc/vendor/browser-es-module-loader/dist/babel-worker.js14
8 files changed, 74 insertions, 59 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7db22b6..0be6671 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,10 @@
-cmake_minimum_required(VERSION 2.6)
+
+##### set project version ########################
+
+include( TDEVersion )
+cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} )
+tde_set_project_version( )
+
if( POLICY CMP0037 )
cmake_policy(SET CMP0037 NEW)
endif( POLICY CMP0037 )
@@ -314,7 +320,7 @@ endif(WITH_SASL AND LIBSASL2_LIBRARIES AND SASL2_INCLUDE_DIR)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rfb/rfbconfig.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/rfb/rfbconfig.h)
set(LIBVNCSERVER_SOURCES
- ${LIBVNCSERVER_DIR}/main.cc
+ ${LIBVNCSERVER_DIR}/main.cpp
${LIBVNCSERVER_DIR}/rfbserver.c
${LIBVNCSERVER_DIR}/rfbregion.c
${LIBVNCSERVER_DIR}/auth.c
diff --git a/common/lzoconf.h b/common/lzoconf.h
index 02fb202..6c5fe63 100644
--- a/common/lzoconf.h
+++ b/common/lzoconf.h
@@ -439,6 +439,3 @@ typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u;
#endif
#endif /* already included */
-
-
-/* vim:set ts=4 et: */
diff --git a/common/lzodefs.h b/common/lzodefs.h
index f4ae948..81d9ad4 100644
--- a/common/lzodefs.h
+++ b/common/lzodefs.h
@@ -2994,5 +2994,3 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int_fast64_t) == sizeof(lzo_uint_fast6
#endif
#endif /* already included */
-
-/* vim:set ts=4 sw=4 et: */
diff --git a/libvncclient/sasl.c b/libvncclient/sasl.c
index db240c1..b533adb 100644
--- a/libvncclient/sasl.c
+++ b/libvncclient/sasl.c
@@ -38,6 +38,10 @@
#include <errno.h>
#include <rfb/rfbclient.h>
+#if LIBVNCSERVER_HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
#ifdef WIN32
#undef SOCKET
#include <winsock2.h>
diff --git a/libvncserver/main.cc b/libvncserver/main.cc
deleted file mode 120000
index 8a03e94..0000000
--- a/libvncserver/main.cc
+++ /dev/null
@@ -1 +0,0 @@
-main.c \ No newline at end of file
diff --git a/libvncserver/main.c b/libvncserver/main.cpp
index 74010d0..549e77f 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.cpp
@@ -19,11 +19,6 @@ extern "C" {
#include <stdarg.h>
#include <errno.h>
- #ifndef false
- #define false 0
- #define true -1
- #endif
-
#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -39,10 +34,10 @@ extern "C" {
#include <time.h>
}
-#include <ntqobject.h>
-#include <ntqvariant.h>
-#include <ntqtimer.h>
-#include <ntqthread.h>
+#include <tqobject.h>
+#include <tqvariant.h>
+#include <tqtimer.h>
+#include <tqthread.h>
#include "main.h"
@@ -471,13 +466,13 @@ void rfbMarkRectAsModified(rfbScreenInfoPtr screen,int x1,int y1,int x2,int y2)
#include <unistd.h>
static void *
-clientOutput(void *data)
+clientOutput(ClientOutputHandlerObject::Data d)
{
- rfbClientPtr cl = (rfbClientPtr)data;
+ rfbClientPtr cl = d.rfbData;
rfbBool haveUpdate;
sraRegion* updateRegion;
- while (1) {
+ while (!d.requestExit) {
haveUpdate = false;
while (!haveUpdate) {
if (cl->sock == -1) {
@@ -537,18 +532,18 @@ clientOutput(void *data)
}
static void *
-clientInput(void *data)
+clientInput(OnHoldClientHandlerObject::Data d)
{
- rfbClientPtr cl = (rfbClientPtr)data;
+ rfbClientPtr cl = d.rfbData;
/* Start output thread */
TQEventLoopThread* clientOutputHandlerThread = new TQEventLoopThread();
ClientOutputHandlerObject* clientOutputHandler = new ClientOutputHandlerObject();
- clientOutputHandler->d = cl;
+ clientOutputHandler->d.rfbData = cl;
clientOutputHandler->moveToThread(clientOutputHandlerThread);
- TQTimer::singleShot(0, clientOutputHandler, SLOT(run()));
+ TQTimer::singleShot(0, clientOutputHandler, TQ_SLOT(run()));
clientOutputHandlerThread->start();
- while (1) {
+ while (!d.requestExit) {
fd_set rfds, wfds, efds;
struct timeval tv;
int n;
@@ -594,7 +589,7 @@ clientInput(void *data)
{
/* Reset the pipe */
char buf;
- while (read(cl->pipe_notify_client_thread[0], &buf, sizeof(buf)) == sizeof(buf));
+ while (!d.requestExit && read(cl->pipe_notify_client_thread[0], &buf, sizeof(buf)) == sizeof(buf));
}
if (FD_ISSET(cl->sock, &rfds) || FD_ISSET(cl->sock, &efds))
@@ -602,7 +597,7 @@ clientInput(void *data)
#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
do {
rfbProcessClientMessage(cl);
- } while (webSocketsHasDataInBuffer(cl));
+ } while (!d.requestExit && webSocketsHasDataInBuffer(cl));
#else
rfbProcessClientMessage(cl);
#endif
@@ -613,6 +608,7 @@ clientInput(void *data)
LOCK(cl->updateMutex);
TSIGNAL(cl->updateCond);
UNLOCK(cl->updateMutex);
+ clientOutputHandler->requestExit();
clientOutputHandlerThread->wait();
delete clientOutputHandlerThread;
clientOutputHandlerThread = NULL;
@@ -625,9 +621,9 @@ clientInput(void *data)
}
static void*
-listenerRun(void *data)
+listenerRun(ControlPipeHandlerObject::Data d)
{
- rfbScreenInfoPtr screen=(rfbScreenInfoPtr)data;
+ rfbScreenInfoPtr screen=d.rfbData;
int client_fd;
struct sockaddr_storage peer;
rfbClientPtr cl = NULL;
@@ -645,7 +641,7 @@ listenerRun(void *data)
/* TODO: this thread won't die by restarting the server */
/* TODO: HTTP is not handled */
- while (1) {
+ while (!d.requestExit) {
client_fd = -1;
FD_ZERO(&listen_fds);
if(screen->listenSock >= 0)
@@ -678,9 +674,9 @@ rfbStartOnHoldClient(rfbClientPtr cl)
{
mOnHoldClientHandlerThread = new TQEventLoopThread();
mOnHoldClientHandler = new OnHoldClientHandlerObject();
- mOnHoldClientHandler->d = cl;
+ mOnHoldClientHandler->d.rfbData = cl;
mOnHoldClientHandler->moveToThread(mOnHoldClientHandlerThread);
- TQTimer::singleShot(0, mOnHoldClientHandler, SLOT(run()));
+ TQTimer::singleShot(0, mOnHoldClientHandler, TQ_SLOT(run()));
mOnHoldClientHandlerThread->start();
}
@@ -1102,17 +1098,28 @@ void rfbScreenCleanup(rfbScreenInfoPtr screen)
}
rfbReleaseClientIterator(i);
+ if (mOnHoldClientHandler) {
+ mOnHoldClientHandler->requestExit();
+ }
if (mOnHoldClientHandlerThread) {
- mOnHoldClientHandlerThread->exit();
+ mOnHoldClientHandlerThread->wait();
delete mOnHoldClientHandlerThread;
mOnHoldClientHandlerThread = NULL;
+ }
+ if (mOnHoldClientHandler) {
delete mOnHoldClientHandler;
mOnHoldClientHandler = NULL;
}
+
+ if (mControlPipeHandler) {
+ mControlPipeHandler->requestExit();
+ }
if (mControlPipeHandlerThread) {
- mControlPipeHandlerThread->exit();
+ mControlPipeHandlerThread->wait();
delete mControlPipeHandlerThread;
mControlPipeHandlerThread = NULL;
+ }
+ if (mControlPipeHandler) {
delete mControlPipeHandler;
mControlPipeHandler = NULL;
}
@@ -1310,9 +1317,9 @@ void rfbRunEventLoop(rfbScreenInfoPtr screen, long usec, rfbBool runInBackground
mControlPipeHandlerThread = new TQEventLoopThread();
mControlPipeHandler = new ControlPipeHandlerObject();
- mControlPipeHandler->d = screen;
+ mControlPipeHandler->d.rfbData = screen;
mControlPipeHandler->moveToThread(mControlPipeHandlerThread);
- TQTimer::singleShot(0, mControlPipeHandler, SLOT(run()));
+ TQTimer::singleShot(0, mControlPipeHandler, TQ_SLOT(run()));
mControlPipeHandlerThread->start();
return;
#else
@@ -1329,7 +1336,7 @@ void rfbRunEventLoop(rfbScreenInfoPtr screen, long usec, rfbBool runInBackground
}
ControlPipeHandlerObject::ControlPipeHandlerObject() : TQObject() {
- //
+ d.requestExit = false;
}
ControlPipeHandlerObject::~ControlPipeHandlerObject() {
@@ -1344,7 +1351,7 @@ void ControlPipeHandlerObject::run(void) {
}
OnHoldClientHandlerObject::OnHoldClientHandlerObject() : TQObject() {
- //
+ d.requestExit = false;
}
OnHoldClientHandlerObject::~OnHoldClientHandlerObject() {
@@ -1359,7 +1366,7 @@ void OnHoldClientHandlerObject::run(void) {
}
ClientOutputHandlerObject::ClientOutputHandlerObject() : TQObject() {
- //
+ d.requestExit = false;
}
ClientOutputHandlerObject::~ClientOutputHandlerObject() {
diff --git a/libvncserver/main.h b/libvncserver/main.h
index a02a476..1edd4cc 100644
--- a/libvncserver/main.h
+++ b/libvncserver/main.h
@@ -13,7 +13,7 @@
class ControlPipeHandlerObject : public TQObject
{
- Q_OBJECT
+ TQ_OBJECT
public:
ControlPipeHandlerObject();
@@ -21,14 +21,20 @@ class ControlPipeHandlerObject : public TQObject
public slots:
void run();
+ void requestExit() { d.requestExit = true; }
public:
- rfbScreenInfoPtr d;
+ struct Data
+ {
+ rfbScreenInfoPtr rfbData;
+ bool requestExit;
+ };
+ Data d;
};
class OnHoldClientHandlerObject : public TQObject
{
- Q_OBJECT
+ TQ_OBJECT
public:
OnHoldClientHandlerObject();
@@ -36,14 +42,20 @@ class OnHoldClientHandlerObject : public TQObject
public slots:
void run();
+ void requestExit() { d.requestExit = true; }
public:
- rfbClientPtr d;
+ struct Data
+ {
+ rfbClientPtr rfbData;
+ bool requestExit;
+ };
+ Data d;
};
class ClientOutputHandlerObject : public TQObject
{
- Q_OBJECT
+ TQ_OBJECT
public:
ClientOutputHandlerObject();
@@ -51,9 +63,15 @@ class ClientOutputHandlerObject : public TQObject
public slots:
void run();
+ void requestExit() { d.requestExit = true; }
public:
- rfbClientPtr d;
+ struct Data
+ {
+ rfbClientPtr rfbData;
+ bool requestExit;
+ };
+ Data d;
};
#endif // _MAIN_H
diff --git a/webclients/novnc/vendor/browser-es-module-loader/dist/babel-worker.js b/webclients/novnc/vendor/browser-es-module-loader/dist/babel-worker.js
index 6c40dcc..57b7605 100644
--- a/webclients/novnc/vendor/browser-es-module-loader/dist/babel-worker.js
+++ b/webclients/novnc/vendor/browser-es-module-loader/dist/babel-worker.js
@@ -29245,7 +29245,6 @@ module.exports = function (str) {
trailingStatement: trailingStatement
};
}());
-/* vim: set sw=4 ts=4 et tw=80 : */
},{}],238:[function(require,module,exports){
/*
@@ -29382,7 +29381,6 @@ module.exports = function (str) {
isIdentifierPartES6: isIdentifierPartES6
};
}());
-/* vim: set sw=4 ts=4 et tw=80 : */
},{}],239:[function(require,module,exports){
/*
@@ -29549,7 +29547,6 @@ module.exports = function (str) {
isIdentifierES6: isIdentifierES6
};
}());
-/* vim: set sw=4 ts=4 et tw=80 : */
},{"./code":238}],240:[function(require,module,exports){
/*
@@ -29584,7 +29581,6 @@ module.exports = function (str) {
exports.code = require('./code');
exports.keyword = require('./keyword');
}());
-/* vim: set sw=4 ts=4 et tw=80 : */
},{"./ast":237,"./code":238,"./keyword":239}],241:[function(require,module,exports){
module.exports={
@@ -40323,7 +40319,6 @@ module.exports = function (str) {
};
},{}],474:[function(require,module,exports){
-/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -40429,7 +40424,6 @@ ArraySet.prototype.toArray = function ArraySet_toArray() {
exports.ArraySet = ArraySet;
},{"./util":483}],475:[function(require,module,exports){
-/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -40571,7 +40565,6 @@ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
};
},{"./base64":476}],476:[function(require,module,exports){
-/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -40640,7 +40633,6 @@ exports.decode = function (charCode) {
};
},{}],477:[function(require,module,exports){
-/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -40753,7 +40745,6 @@ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
};
},{}],478:[function(require,module,exports){
-/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2014 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -40834,7 +40825,6 @@ MappingList.prototype.toArray = function MappingList_toArray() {
exports.MappingList = MappingList;
},{"./util":483}],479:[function(require,module,exports){
-/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -40950,7 +40940,6 @@ exports.quickSort = function (ary, comparator) {
};
},{}],480:[function(require,module,exports){
-/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -42034,7 +42023,6 @@ IndexedSourceMapConsumer.prototype._parseMappings =
exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
},{"./array-set":474,"./base64-vlq":475,"./binary-search":477,"./quick-sort":479,"./util":483}],481:[function(require,module,exports){
-/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -42440,7 +42428,6 @@ SourceMapGenerator.prototype.toString =
exports.SourceMapGenerator = SourceMapGenerator;
},{"./array-set":474,"./base64-vlq":475,"./mapping-list":478,"./util":483}],482:[function(require,module,exports){
-/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -42849,7 +42836,6 @@ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSou
exports.SourceNode = SourceNode;
},{"./source-map-generator":481,"./util":483}],483:[function(require,module,exports){
-/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or: