diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-10-09 10:23:59 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-10-09 10:25:17 +0200 |
commit | 4a4453fc69cf56f9991a13a62023969dcf5b8a4f (patch) | |
tree | dc89029e8a2b9976ce2f47ae5c50bdcf86bd277a /win/winvnc | |
parent | 2b69d385e669bf97d872fd116c7f1da5aee7cdfd (diff) | |
download | tigervnc-4a4453fc69cf56f9991a13a62023969dcf5b8a4f.tar.gz tigervnc-4a4453fc69cf56f9991a13a62023969dcf5b8a4f.zip |
Remove Java web server
Applets don't work anymore so remove everything that has to do
with serving them.
Diffstat (limited to 'win/winvnc')
-rw-r--r-- | win/winvnc/CMakeLists.txt | 13 | ||||
-rw-r--r-- | win/winvnc/JavaViewer.cxx | 107 | ||||
-rw-r--r-- | win/winvnc/JavaViewer.h | 56 | ||||
-rw-r--r-- | win/winvnc/VNCServerWin32.cxx | 11 | ||||
-rw-r--r-- | win/winvnc/VNCServerWin32.h | 7 | ||||
-rw-r--r-- | win/winvnc/index.vnc | 22 | ||||
-rw-r--r-- | win/winvnc/resource.h | 1 | ||||
-rw-r--r-- | win/winvnc/winvnc.rc (renamed from win/winvnc/winvnc.rc.in) | 12 |
8 files changed, 2 insertions, 227 deletions
diff --git a/win/winvnc/CMakeLists.txt b/win/winvnc/CMakeLists.txt index ac9ae298..113796c8 100644 --- a/win/winvnc/CMakeLists.txt +++ b/win/winvnc/CMakeLists.txt @@ -1,29 +1,18 @@ include_directories(${CMAKE_BINARY_DIR}/win ${CMAKE_CURRENT_SOURCE_DIR}) -set(VNCVIEWER_JAR_PATH ${CMAKE_BINARY_DIR}/java/VncViewer.jar) -set(INDEX_VNC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/index.vnc) - -configure_file(winvnc.rc.in winvnc.rc) - add_executable(winvnc4 WIN32 buildTime.cxx ControlPanel.cxx - JavaViewer.cxx ManagedListener.cxx QueryConnectDialog.cxx STrayIcon.cxx VNCServerService.cxx VNCServerWin32.cxx winvnc.cxx - ${CMAKE_CURRENT_BINARY_DIR}/winvnc.rc) + winvnc.rc) target_link_libraries(winvnc4 rfb rfb_win32 network rdr ws2_32.lib) -if(BUILD_JAVA) - set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/winvnc.rc - PROPERTIES OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/java/VncViewer.jar) -endif() - install(TARGETS winvnc4 RUNTIME DESTINATION ${BIN_DIR} ) diff --git a/win/winvnc/JavaViewer.cxx b/win/winvnc/JavaViewer.cxx deleted file mode 100644 index e2e307e8..00000000 --- a/win/winvnc/JavaViewer.cxx +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * - * This is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - -#include <winvnc/JavaViewer.h> -#include <winvnc/VNCServerWin32.h> -#include <winvnc/resource.h> -#include <rdr/MemInStream.h> -#include <rfb/LogWriter.h> -#include <rfb/VNCServerST.h> -#include <rfb_win32/TCharArray.h> - -#include <windows.h> - -using namespace winvnc; -using namespace rfb; - - -static rfb::LogWriter vlog("JavaViewerServer"); - -JavaViewerServer::JavaViewerServer(VNCServerWin32* svr) : server(svr) { -} - -JavaViewerServer::~JavaViewerServer() { -} - -rdr::InStream* JavaViewerServer::getFile(const char* name, - const char** contentType, - int* contentLength, - time_t* lastModified) -{ - if (strcmp(name, "/") == 0) - name = "/index.vnc"; - if (strcmp(name, "/VncViewer.jar") == 0) - name = "VncViewer.jar"; - if (strcmp(name, "/index.vnc") == 0) - name = "index.vnc"; - - HRSRC resource = FindResource(0, TStr(name), _T("HTTPFILE")); - if (!resource) return 0; - HGLOBAL handle = LoadResource(0, resource); - if (!handle) return 0; - void* buf = LockResource(handle); - int len = SizeofResource(0, resource); - - rdr::InStream* is = new rdr::MemInStream(buf, len); - if (strlen(name) > 4 && strcasecmp(&name[strlen(name)-4], ".vnc") == 0) { - is = new rdr::SubstitutingInStream(is, this, 20); - *contentType = "text/html"; - } - return is; -} - -char* JavaViewerServer::substitute(const char* varName) -{ - if (strcmp(varName, "$$") == 0) { - return rfb::strDup("$"); - } - if (strcmp(varName, "$PORT") == 0) { - char* str = new char[10]; - sprintf(str, "%d", rfbPort); - return str; - } - if (strcmp(varName, "$WIDTH") == 0) { - char* str = new char[10]; - sprintf(str, "%d", server->getDesktopSize().x); - return str; - } - if (strcmp(varName, "$HEIGHT") == 0) { - char* str = new char[10]; - sprintf(str, "%d", server->getDesktopSize().y); - return str; - } - if (strcmp(varName, "$APPLETWIDTH") == 0) { - char* str = new char[10]; - sprintf(str, "%d", server->getDesktopSize().x); - return str; - } - if (strcmp(varName, "$APPLETHEIGHT") == 0) { - char* str = new char[10]; - sprintf(str, "%d", server->getDesktopSize().y); - return str; - } - if (strcmp(varName, "$DESKTOP") == 0) { - return rfb::strDup(server->getName()); - } - if (strcmp(varName, "$USER") == 0) { - char tempStr[256]; DWORD tempStrLen = 256; - GetUserName(tempStr, &tempStrLen); - return rfb::strDup(tempStr); - } - return 0; -} diff --git a/win/winvnc/JavaViewer.h b/win/winvnc/JavaViewer.h deleted file mode 100644 index 79a39696..00000000 --- a/win/winvnc/JavaViewer.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * - * This is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ - -// -=- JavaViewer.h - -// Custom HTTPServer-derived class which serves the Java VNC Viewer -// to clients, using resource files compiled in to the WinVNC executable. - -#ifndef WINVNC_JAVA_VIEWER -#define WINVNC_JAVA_VIEWER - -#include <rfb/HTTPServer.h> -#include <rdr/SubstitutingInStream.h> - -namespace winvnc { - - class VNCServerWin32; - - class JavaViewerServer : public rfb::HTTPServer, public rdr::Substitutor { - public: - JavaViewerServer(VNCServerWin32* desktop); - virtual ~JavaViewerServer(); - - virtual rdr::InStream* getFile(const char* name, const char** contentType, - int* contentLength, time_t* lastModified); - - // rdr::Substitutor callback - virtual char* substitute(const char* varName); - - void setRFBport(int port) { - rfbPort = port; - } - protected: - int rfbPort; - VNCServerWin32* server; - }; - -}; - -#endif - diff --git a/win/winvnc/VNCServerWin32.cxx b/win/winvnc/VNCServerWin32.cxx index b164c65f..9f6a954d 100644 --- a/win/winvnc/VNCServerWin32.cxx +++ b/win/winvnc/VNCServerWin32.cxx @@ -42,8 +42,6 @@ static LogWriter vlog("VNCServerWin32"); const TCHAR* winvnc::VNCServerWin32::RegConfigPath = _T("Software\\TigerVNC\\WinVNC4"); -static IntParameter http_port("HTTPPortNumber", - "TCP/IP port on which the server will serve the Java applet VNC Viewer ", 5800); static IntParameter port_number("PortNumber", "TCP/IP port on which the server will accept connections", 5900); static StringParameter hosts("Hosts", @@ -63,8 +61,7 @@ VNCServerWin32::VNCServerWin32() CreateEvent(0, FALSE, FALSE, "Global\\SessionEventTigerVNC") : 0), vncServer(CStr(ComputerName().buf), &desktop), thread_id(-1), runServer(false), isDesktopStarted(false), - httpServer(this), config(&sockMgr), - rfbSock(&sockMgr), httpSock(&sockMgr), trayIcon(0), + config(&sockMgr), rfbSock(&sockMgr), trayIcon(0), queryConnectDialog(0) { commandLock = new os::Mutex; @@ -148,16 +145,10 @@ void VNCServerWin32::regConfigChanged() { // -=- Make sure we're listening on the right ports. rfbSock.setServer(&vncServer); rfbSock.setPort(port_number, localHost); - httpSock.setServer(&httpServer); - httpSock.setPort(http_port, localHost); - - // -=- Update the Java viewer's web page port number. - httpServer.setRFBport(rfbSock.isListening() ? port_number : 0); // -=- Update the TCP address filter for both ports, if open. CharArray pattern(hosts.getData()); rfbSock.setFilter(pattern.buf); - httpSock.setFilter(pattern.buf); // -=- Update the tray icon tooltip text with IP addresses processAddressChange(); diff --git a/win/winvnc/VNCServerWin32.h b/win/winvnc/VNCServerWin32.h index ed051dcf..271cb76a 100644 --- a/win/winvnc/VNCServerWin32.h +++ b/win/winvnc/VNCServerWin32.h @@ -27,7 +27,6 @@ #include <rfb_win32/SocketManager.h> #include <rfb_win32/TCharArray.h> #include <winvnc/QueryConnectDialog.h> -#include <winvnc/JavaViewer.h> #include <winvnc/ManagedListener.h> namespace os { @@ -78,10 +77,6 @@ namespace winvnc { bool setClientsStatus(rfb::ListConnInfo* LCInfo); - // Used by JavaViewerServer - const char* getName() {return vncServer.getName();} - rfb::Point getDesktopSize() {return desktop.getFbSize();} - protected: // VNCServerST::QueryConnectionHandler interface // Callback used to prompt user to accept or reject a connection. @@ -121,12 +116,10 @@ namespace winvnc { DWORD thread_id; bool runServer; bool isDesktopStarted; - JavaViewerServer httpServer; rfb::win32::SocketManager sockMgr; rfb::win32::RegConfig config; ManagedListener rfbSock; - ManagedListener httpSock; STrayIconThread* trayIcon; QueryConnectDialog* queryConnectDialog; diff --git a/win/winvnc/index.vnc b/win/winvnc/index.vnc deleted file mode 100644 index 560fa2e8..00000000 --- a/win/winvnc/index.vnc +++ /dev/null @@ -1,22 +0,0 @@ -<!-- - index.vnc - default HTML page for TigerVNC Java viewer applet, to be - used with WinVNC. On any file ending in .vnc, the HTTP server embedded in - WinVNC will substitute the following variables when preceded by a dollar: - USER, DESKTOP, APPLETWIDTH, APPLETHEIGHT, WIDTH, HEIGHT, PORT, - Use two dollar signs ($$) to get a dollar sign in the generated - HTML page. ---> - -<HTML> -<TITLE> -$USER's $DESKTOP desktop -</TITLE> -<APPLET CODE=com.tigervnc.vncviewer.VncViewer ARCHIVE=VncViewer.jar - WIDTH=$APPLETWIDTH HEIGHT=$APPLETHEIGHT> -<param name=PORT value=$PORT> -<param name="Embed" value="true"> -<param name="draggable" value="true"> -</APPLET> -<BR> -<A href="http://www.tigervnc.org/">TigerVNC site</A> -</HTML> diff --git a/win/winvnc/resource.h b/win/winvnc/resource.h index 68316be9..0e52368c 100644 --- a/win/winvnc/resource.h +++ b/win/winvnc/resource.h @@ -8,7 +8,6 @@ #define IDD_DIALOG1 103 #define IDD_ABOUT 104 #define IDI_CONNECTED 105 -#define IDR_VNCVIEWER_JAR 106 #define IDD_QUERY_CONNECT 107 #define IDD_ADD_NEW_CLIENT 108 #define IDB_BITMAP 109 diff --git a/win/winvnc/winvnc.rc.in b/win/winvnc/winvnc.rc index 2b50966e..44cb71ca 100644 --- a/win/winvnc/winvnc.rc.in +++ b/win/winvnc/winvnc.rc @@ -217,18 +217,6 @@ END ///////////////////////////////////////////////////////////////////////////// // -// HTTPFILE -// - -#cmakedefine BUILD_JAVA - -#ifdef BUILD_JAVA -VNCVIEWER.JAR HTTPFILE DISCARDABLE "@VNCVIEWER_JAR_PATH@" -INDEX.VNC HTTPFILE DISCARDABLE "@INDEX_VNC_PATH@" -#endif - -///////////////////////////////////////////////////////////////////////////// -// // 24 // |