From db7feaf9883bb0dc419593588036405ef12ebca1 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Thu, 28 Mar 2013 08:58:35 +0100 Subject: Revert "release 3.5.0.19" This reverts commit e77bf36d9afbc7e56522574b06217d57c11dd095. --- nxcomp/Agent.h | 28 +++++++---------------- nxcomp/Auth.cpp | 17 ++++---------- nxcomp/Loop.cpp | 64 +++++++++++++++++++---------------------------------- nxcomp/Makefile.in | 41 ++-------------------------------- nxcomp/Message.cpp | 4 ++-- nxcomp/Misc.cpp | 18 ++++----------- nxcomp/Misc.h | 12 ++-------- nxcomp/Pgn.cpp | 6 ++--- nxcomp/Proxy.cpp | 4 ++-- nxcomp/Split.cpp | 2 +- nxcomp/configure.in | 4 ++-- 11 files changed, 53 insertions(+), 147 deletions(-) (limited to 'nxcomp') diff --git a/nxcomp/Agent.h b/nxcomp/Agent.h index ded344d84..fac5acd43 100644 --- a/nxcomp/Agent.h +++ b/nxcomp/Agent.h @@ -149,38 +149,30 @@ class Agent int remoteCanRead(const fd_set * const readSet) { - // OS X 10.5 requires the second argument to be non-const, so copy readSet. - // It's safe though, as FD_ISSET does not operate on it. - fd_set readWorkSet = *readSet; - #if defined(TEST) || defined(INFO) *logofs << "Agent: remoteCanRead() is " << - (FD_ISSET(remoteFd_, &readWorkSet) && transport_ -> dequeuable() != 0) - << " with FD_ISSET() " << (int) FD_ISSET(remoteFd_, &readWorkSet) + (FD_ISSET(remoteFd_, readSet) && transport_ -> dequeuable() != 0) + << " with FD_ISSET() " << (int) FD_ISSET(remoteFd_, readSet) << " and dequeuable " << transport_ -> dequeuable() << ".\n" << logofs_flush; #endif - return (FD_ISSET(remoteFd_, &readWorkSet) && + return (FD_ISSET(remoteFd_, readSet) && transport_ -> dequeuable() != 0); } int remoteCanWrite(const fd_set * const writeSet) { - // OS X 10.5 requires the second argument to be non-const, so copy writeSet. - // It's safe though, as FD_ISSET does not operate on it. - fd_set writeWorkSet = *writeSet; - #if defined(TEST) || defined(INFO) *logofs << "Agent: remoteCanWrite() is " << - (FD_ISSET(remoteFd_, &writeWorkSet) && transport_ -> + (FD_ISSET(remoteFd_, writeSet) && transport_ -> queuable() != 0 && canRead_ == 1) << " with FD_ISSET() " - << (int) FD_ISSET(remoteFd_, &writeWorkSet) << " queueable " + << (int) FD_ISSET(remoteFd_, writeSet) << " queueable " << transport_ -> queuable() << " channel can read " << canRead_ << ".\n" << logofs_flush; #endif - return (FD_ISSET(remoteFd_, &writeWorkSet) && + return (FD_ISSET(remoteFd_, writeSet) && transport_ -> queuable() != 0 && canRead_ == 1); } @@ -211,17 +203,13 @@ class Agent int proxyCanRead(const fd_set * const readSet) { - // OS X 10.5 requires the second argument to be non-const, so copy readSet. - // It's safe though, as FD_ISSET does not operate on it. - fd_set readWorkSet = *readSet; - #if defined(TEST) || defined(INFO) *logofs << "Agent: proxyCanRead() is " - << ((int) FD_ISSET(proxy -> getFd(), &readWorkSet) + << ((int) FD_ISSET(proxy -> getFd(), readSet) << ".\n" << logofs_flush; #endif - return (FD_ISSET(proxy -> getFd(), &readWorkSet)); + return (FD_ISSET(proxy -> getFd(), readSet)); } int enqueueData(const char *data, const int size) const diff --git a/nxcomp/Auth.cpp b/nxcomp/Auth.cpp index c52392a51..d8e999132 100644 --- a/nxcomp/Auth.cpp +++ b/nxcomp/Auth.cpp @@ -217,31 +217,22 @@ int Auth::getCookie() // // Use the nxauth command on Windows and the Mac, xauth - // on all the other platforms. On Windows we assume that - // the nxauth command is located under bin in the client - // installation directory. On Mac OS X we assume that the - // command is located directly in the client installation - // directory, to make bundle shipping easier. On all the + // on all the other platforms. On Windows and on the Mac + // we assume that the nxauth command is located under + // bin in the client installation directory. On all the // other platforms we use the default xauth command that // is in our path. // char command[DEFAULT_STRING_LIMIT]; - #if defined(__CYGWIN32__) + #if defined(__CYGWIN32__) || defined(__APPLE__) snprintf(command, DEFAULT_STRING_LIMIT - 1, "%s/bin/nxauth", control -> SystemPath); *(command + DEFAULT_STRING_LIMIT - 1) = '\0'; - #elif defined(__APPLE__) - - snprintf(command, DEFAULT_STRING_LIMIT - 1, - "%s/nxauth", control -> SystemPath); - - *(command + DEFAULT_STRING_LIMIT - 1) = '\0'; - #else strcpy(command, "xauth"); diff --git a/nxcomp/Loop.cpp b/nxcomp/Loop.cpp index 8069af598..92b6fc28f 100644 --- a/nxcomp/Loop.cpp +++ b/nxcomp/Loop.cpp @@ -952,7 +952,6 @@ static char listenHost[DEFAULT_STRING_LENGTH] = { 0 }; static char displayHost[DEFAULT_STRING_LENGTH] = { 0 }; static char authCookie[DEFAULT_STRING_LENGTH] = { 0 }; -static int loopbackBind = DEFAULT_LOOPBACK_BIND; static int proxyPort = DEFAULT_NX_PROXY_PORT; static int xPort = DEFAULT_NX_X_PORT; @@ -3960,14 +3959,7 @@ int SetupTcpSocket() tcpAddr.sin_family = AF_INET; tcpAddr.sin_port = htons(proxyPortTCP); - if ( loopbackBind ) - { - tcpAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - } - else - { - tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); - } + tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); if (bind(tcpFD, (sockaddr *) &tcpAddr, sizeof(tcpAddr)) == -1) { @@ -4520,14 +4512,7 @@ int ListenConnection(int port, const char *label) tcpAddr.sin_family = AF_INET; tcpAddr.sin_port = htons(portTCP); - if ( loopbackBind ) - { - tcpAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - } - else - { - tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); - } + tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); if (bind(newFD, (sockaddr *) &tcpAddr, sizeof(tcpAddr)) == -1) { @@ -5899,10 +5884,21 @@ void InstallSignal(int signal, int action) struct sigaction newAction; - memset(&newAction, 0, sizeof(newAction)); - newAction.sa_handler = HandleSignal; + // + // This field doesn't exist on most OSes except + // Linux. We keep setting the field to NULL to + // avoid side-effects in the case the field is + // a value return. + // + + #if defined(__linux__) + + newAction.sa_restorer = NULL; + + #endif + sigemptyset(&(newAction.sa_mask)); if (signal == SIGCHLD) @@ -6513,10 +6509,14 @@ void SetTimer(int value) struct sigaction action; - memset(&action, 0, sizeof(action)); - action.sa_handler = HandleTimer; + #if defined(__linux__) + + action.sa_restorer = NULL; + + #endif + sigemptyset(&action.sa_mask); action.sa_flags = 0; @@ -6695,14 +6695,7 @@ int WaitForRemote(int portNum) #ifdef __APPLE__ - if ( loopbackBind ) - { - tcpAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - } - else - { - tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); - } + tcpAddr.sin_addr.s_addr = htonl(INADDR_ANY); #else @@ -8381,10 +8374,6 @@ int ParseEnvironmentOptions(const char *env, int force) listenPort = ValidateArg("local", name, value); } - else if (strcasecmp(name, "loopback") == 0) - { - loopbackBind = ValidateArg("local", name, value); - } else if (strcasecmp(name, "accept") == 0) { if (*connectHost != '\0') @@ -13761,14 +13750,7 @@ int ParseListenOption(int &address) } else { - if ( loopbackBind ) - { - address = htonl(INADDR_LOOPBACK); - } - else - { - address = htonl(INADDR_ANY); - } + address = htonl(INADDR_ANY); } } else diff --git a/nxcomp/Makefile.in b/nxcomp/Makefile.in index 5a8633281..434118b4e 100644 --- a/nxcomp/Makefile.in +++ b/nxcomp/Makefile.in @@ -64,15 +64,10 @@ exec_prefix = @exec_prefix@ bindir = @bindir@ man1dir = @mandir@/man1 VPATH = @srcdir@ -libdir = @libdir@ -includedir = @includedir@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ -INSTALL_LINK = cp -av -DESTDIR = -RM_FILE = rm -f # # This should be autodetected. @@ -269,48 +264,16 @@ depend.status: fi touch depend.status -install: install.bin install.lib install.man +install: install.bin install.man install.bin: -install.lib: all - ./mkinstalldirs $(DESTDIR)${libdir}/nx - ./mkinstalldirs $(DESTDIR)${includedir}/nx - $(INSTALL_DATA) $(LIBFULL) $(DESTDIR)${libdir}/nx - $(INSTALL_LINK) libXcomp.so.3 $(DESTDIR)${libdir}/nx - $(INSTALL_LINK) libXcomp.so $(DESTDIR)${libdir}/nx - $(INSTALL_DATA) libXcomp.a $(DESTDIR)${libdir}/nx - $(INSTALL_DATA) NX*.h $(DESTDIR)${includedir}/nx - $(INSTALL_DATA) MD5.h $(DESTDIR)${includedir}/nx - echo "Running ldconfig tool, this may take a while..." && ldconfig || true - install.man: -uninstall: uninstall.bin uninstall.lib uninstall.man - -uninstall.bin: - -uninstall.lib: - $(RM_FILE) $(DESTDIR)${libdir}/nx/$(LIBFULL) - $(RM_FILE) $(DESTDIR)${libdir}/nx/libXcomp.so.3 - $(RM_FILE) $(DESTDIR)${libdir}/nx/libXcomp.so - $(RM_FILE) $(DESTDIR)${libdir}/nx/libXcomp.a - $(RM_FILE) $(DESTDIR)${includedir}/nx/NXalert.h - $(RM_FILE) $(DESTDIR)${includedir}/nx/NX.h - $(RM_FILE) $(DESTDIR)${includedir}/nx/NXmitshm.h - $(RM_FILE) $(DESTDIR)${includedir}/nx/NXpack.h - $(RM_FILE) $(DESTDIR)${includedir}/nx/NXproto.h - $(RM_FILE) $(DESTDIR)${includedir}/nx/NXrender.h - $(RM_FILE) $(DESTDIR)${includedir}/nx/NXvars.h - $(RM_FILE) $(DESTDIR)${includedir}/nx/MD5.h - echo "Running ldconfig tool, this may take a while..." && ldconfig || true - -uninstall.man: - clean: -rm -f *~ *.o *.bak *.orig *.rej st?????? core core.* *.out.* \ @ALL@ distclean: clean -rm -rf autom4te.cache config.status config.log \ - config.cache depend.status Makefile tags configure + config.cache depend.status Makefile tags diff --git a/nxcomp/Message.cpp b/nxcomp/Message.cpp index 188ed9a0e..72d4fff3d 100644 --- a/nxcomp/Message.cpp +++ b/nxcomp/Message.cpp @@ -15,9 +15,9 @@ /* */ /**************************************************************************/ -#include +#include #include -#include +#include #include diff --git a/nxcomp/Misc.cpp b/nxcomp/Misc.cpp index 0095eaa74..2c72259e3 100644 --- a/nxcomp/Misc.cpp +++ b/nxcomp/Misc.cpp @@ -15,11 +15,11 @@ /* */ /**************************************************************************/ -#include -#include -#include +#include +#include +#include #include -#include +#include #include #include @@ -41,14 +41,6 @@ #undef TEST #undef DEBUG -// -// By default nxproxy binds to all network interfaces, setting -// DEFAULT_LOOPBACK_BIND to 1 enables binding to the loopback -// device only. -// - -const int DEFAULT_LOOPBACK_BIND = 0; - // // TCP port offset applied to any NX port specification. // @@ -144,8 +136,6 @@ static const char UsageInfo[] = to be forwarded by the proxy running on the client.\n\ \n\ listen=n Local port used for accepting the proxy connection.\n\ -\n\ - loopback=b Bind to the loopback device only.\n\ \n\ accept=s Name or IP of host that can connect to the proxy.\n\ \n\ diff --git a/nxcomp/Misc.h b/nxcomp/Misc.h index 21a503082..200831757 100644 --- a/nxcomp/Misc.h +++ b/nxcomp/Misc.h @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #ifdef __sun @@ -89,14 +89,6 @@ extern const int DEFAULT_NX_FONT_PORT_OFFSET; extern const int DEFAULT_NX_SLAVE_PORT_CLIENT_OFFSET; extern const int DEFAULT_NX_SLAVE_PORT_SERVER_OFFSET; -// -// NX proxy binds to all network interfaces by default -// With the -loopback parameter, you can switch -// over to binding to the loopback device only. -// - -extern const int DEFAULT_LOOPBACK_BIND; - // // Return strings containing various info. // diff --git a/nxcomp/Pgn.cpp b/nxcomp/Pgn.cpp index af26724ef..a68373441 100644 --- a/nxcomp/Pgn.cpp +++ b/nxcomp/Pgn.cpp @@ -414,7 +414,7 @@ int DecompressPng16(unsigned char *compressedData, int compressedLen, png_read_info(pngPtr, infoPtr); - if (png_get_color_type(pngPtr, infoPtr) == PNG_COLOR_TYPE_PALETTE) + if (infoPtr -> color_type == PNG_COLOR_TYPE_PALETTE) { png_set_expand(pngPtr); } @@ -565,7 +565,7 @@ int DecompressPng24(unsigned char *compressedData, int compressedLen, png_read_info( pngPtr, infoPtr ) ; - if (png_get_color_type(pngPtr, infoPtr) == PNG_COLOR_TYPE_PALETTE) + if (infoPtr -> color_type == PNG_COLOR_TYPE_PALETTE) { png_set_expand(pngPtr); } @@ -709,7 +709,7 @@ int DecompressPng32(unsigned char *compressedData, int compressedLen, png_read_info(pngPtr, infoPtr) ; - if (png_get_color_type(pngPtr, infoPtr) == PNG_COLOR_TYPE_PALETTE) + if (infoPtr -> color_type == PNG_COLOR_TYPE_PALETTE) { png_set_expand(pngPtr); } diff --git a/nxcomp/Proxy.cpp b/nxcomp/Proxy.cpp index d6c67e0e8..3b4df7eb6 100644 --- a/nxcomp/Proxy.cpp +++ b/nxcomp/Proxy.cpp @@ -15,9 +15,9 @@ /* */ /**************************************************************************/ -#include +#include #include -#include +#include #include #include diff --git a/nxcomp/Split.cpp b/nxcomp/Split.cpp index 35a4ed4a2..50627e793 100644 --- a/nxcomp/Split.cpp +++ b/nxcomp/Split.cpp @@ -16,7 +16,7 @@ /**************************************************************************/ #include -#include +#include #include #include #include diff --git a/nxcomp/configure.in b/nxcomp/configure.in index 6fa9757a7..e9ab81da8 100644 --- a/nxcomp/configure.in +++ b/nxcomp/configure.in @@ -7,8 +7,8 @@ AC_PREREQ(2.13) dnl Set our default compilation flags. -CXXFLAGS="$CXXFLAGS -O3 -fno-rtti -fno-exceptions" -CFLAGS="$CFLAGS -O3" +CXXFLAGS="-O3 -fno-rtti -fno-exceptions" +CFLAGS="-O3" dnl Reset default linking directives. -- cgit v1.2.3