From a9595fbf79b631f02b47bcf117b508e9de93659f Mon Sep 17 00:00:00 2001 From: "Brian P. Hinz" Date: Thu, 13 Nov 2014 21:12:49 -0500 Subject: [PATCH] Java code cleanup Deleted some useless comments in java viewer --- java/com/tigervnc/network/Socket.java | 27 ------------------- java/com/tigervnc/network/SocketListener.java | 3 --- java/com/tigervnc/network/TcpListener.java | 20 -------------- 3 files changed, 50 deletions(-) diff --git a/java/com/tigervnc/network/Socket.java b/java/com/tigervnc/network/Socket.java index bcc920de..651dc05a 100644 --- a/java/com/tigervnc/network/Socket.java +++ b/java/com/tigervnc/network/Socket.java @@ -58,7 +58,6 @@ abstract public class Socket { // Is the remote end on the same machine? abstract public boolean sameMachine(); - // Was there a "?" in the ConnectionFilter used to accept this Socket? public void setRequiresQuery() {queryConnection = true;} public final boolean requiresQuery() {return queryConnection;} @@ -78,29 +77,3 @@ abstract public class Socket { boolean isShutdown_; boolean queryConnection; } - -/* -abstract class ConnectionFilter { - public abstract boolean verifyConnection(Socket s); -}; - -abstract class SocketListener { - public SocketListener() { - fd = null; filter = null; - } - - // shutdown() stops the socket from accepting further connections - public abstract void shutdown(); - - // accept() returns a new Socket object if there is a connection - // attempt in progress AND if the connection passes the filter - // if one is installed. Otherwise, returns 0. - public abstract Socket accept(); - - // setFilter() applies the specified filter to all new connections - public void setFilter(ConnectionFilter f) {filter = f;} - //public SocketDescriptor getFd() {return fd;} - protected FileDescriptor fd; - protected ConnectionFilter filter; -}; -*/ diff --git a/java/com/tigervnc/network/SocketListener.java b/java/com/tigervnc/network/SocketListener.java index a1b2c122..6401c2cc 100644 --- a/java/com/tigervnc/network/SocketListener.java +++ b/java/com/tigervnc/network/SocketListener.java @@ -36,11 +36,8 @@ abstract public class SocketListener { // if one is installed. Otherwise, returns 0. abstract public Socket accept(); - // setFilter() applies the specified filter to all new connections - //public void setFilter(ConnectionFilter* f) {filter = f;} public FileDescriptor getFd() {return fd;} protected FileDescriptor fd; - //protected ConnectionFilter* filter; } diff --git a/java/com/tigervnc/network/TcpListener.java b/java/com/tigervnc/network/TcpListener.java index bab9e4c5..b66558b9 100644 --- a/java/com/tigervnc/network/TcpListener.java +++ b/java/com/tigervnc/network/TcpListener.java @@ -132,29 +132,9 @@ public class TcpListener extends SocketListener { } fd.setChannel(new_sock); TcpSocket s = new TcpSocket(fd); - //if (filter && !filter->verifyConnection(s)) { - // delete s; - // return 0; - //} return s; } -/* -void TcpListener::getMyAddresses(std::list* result) { - const hostent* addrs = gethostbyname(0); - if (addrs == 0) - throw rdr::SystemException("gethostbyname", errorNumber); - if (addrs->h_addrtype != AF_INET) - throw rdr::Exception("getMyAddresses: bad family"); - for (int i=0; addrs->h_addr_list[i] != 0; i++) { - const char* addrC = inet_ntoa(*((struct in_addr*)addrs->h_addr_list[i])); - char* addr = new char[strlen(addrC)+1]; - strcpy(addr, addrC); - result->push_back(addr); - } -} - */ - //public int getMyPort() { // return TcpSocket.getSockPort(); //} -- 2.39.5