resolve #4337 removed IStreamFilterFactory dead code
This commit is contained in:
parent
a53dae9be3
commit
d80aa7c938
|
@ -30,7 +30,6 @@
|
||||||
#include "synergy/FileChunker.h"
|
#include "synergy/FileChunker.h"
|
||||||
#include "synergy/IPlatformScreen.h"
|
#include "synergy/IPlatformScreen.h"
|
||||||
#include "mt/Thread.h"
|
#include "mt/Thread.h"
|
||||||
#include "io/IStreamFilterFactory.h"
|
|
||||||
#include "io/CryptoStream.h"
|
#include "io/CryptoStream.h"
|
||||||
#include "net/TCPSocket.h"
|
#include "net/TCPSocket.h"
|
||||||
#include "net/IDataSocket.h"
|
#include "net/IDataSocket.h"
|
||||||
|
@ -61,7 +60,6 @@ Client::Client(
|
||||||
IEventQueue* events,
|
IEventQueue* events,
|
||||||
const String& name, const NetworkAddress& address,
|
const String& name, const NetworkAddress& address,
|
||||||
ISocketFactory* socketFactory,
|
ISocketFactory* socketFactory,
|
||||||
IStreamFilterFactory* streamFilterFactory,
|
|
||||||
synergy::Screen* screen,
|
synergy::Screen* screen,
|
||||||
const CryptoOptions& crypto,
|
const CryptoOptions& crypto,
|
||||||
bool enableDragDrop) :
|
bool enableDragDrop) :
|
||||||
|
@ -69,7 +67,6 @@ Client::Client(
|
||||||
m_name(name),
|
m_name(name),
|
||||||
m_serverAddress(address),
|
m_serverAddress(address),
|
||||||
m_socketFactory(socketFactory),
|
m_socketFactory(socketFactory),
|
||||||
m_streamFilterFactory(streamFilterFactory),
|
|
||||||
m_screen(screen),
|
m_screen(screen),
|
||||||
m_stream(NULL),
|
m_stream(NULL),
|
||||||
m_timer(NULL),
|
m_timer(NULL),
|
||||||
|
@ -127,7 +124,6 @@ Client::~Client()
|
||||||
cleanupConnecting();
|
cleanupConnecting();
|
||||||
cleanupConnection();
|
cleanupConnection();
|
||||||
delete m_socketFactory;
|
delete m_socketFactory;
|
||||||
delete m_streamFilterFactory;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -166,9 +162,6 @@ Client::connect()
|
||||||
// filter socket messages, including a packetizing filter
|
// filter socket messages, including a packetizing filter
|
||||||
m_stream = socket;
|
m_stream = socket;
|
||||||
bool adopt = !useSecureSocket;
|
bool adopt = !useSecureSocket;
|
||||||
if (m_streamFilterFactory != NULL) {
|
|
||||||
m_stream = m_streamFilterFactory->create(m_stream, adopt);
|
|
||||||
}
|
|
||||||
m_stream = new PacketStreamFilter(m_events, m_stream, adopt);
|
m_stream = new PacketStreamFilter(m_events, m_stream, adopt);
|
||||||
|
|
||||||
if (m_crypto.m_mode != kDisabled) {
|
if (m_crypto.m_mode != kDisabled) {
|
||||||
|
|
|
@ -33,7 +33,6 @@ class ServerProxy;
|
||||||
class IDataSocket;
|
class IDataSocket;
|
||||||
class ISocketFactory;
|
class ISocketFactory;
|
||||||
namespace synergy { class IStream; }
|
namespace synergy { class IStream; }
|
||||||
class IStreamFilterFactory;
|
|
||||||
class IEventQueue;
|
class IEventQueue;
|
||||||
class CryptoStream;
|
class CryptoStream;
|
||||||
class Thread;
|
class Thread;
|
||||||
|
@ -61,7 +60,6 @@ public:
|
||||||
Client(IEventQueue* events,
|
Client(IEventQueue* events,
|
||||||
const String& name, const NetworkAddress& address,
|
const String& name, const NetworkAddress& address,
|
||||||
ISocketFactory* socketFactory,
|
ISocketFactory* socketFactory,
|
||||||
IStreamFilterFactory* streamFilterFactory,
|
|
||||||
synergy::Screen* screen,
|
synergy::Screen* screen,
|
||||||
const CryptoOptions& crypto,
|
const CryptoOptions& crypto,
|
||||||
bool enableDragDrop);
|
bool enableDragDrop);
|
||||||
|
@ -212,8 +210,6 @@ private:
|
||||||
String m_name;
|
String m_name;
|
||||||
NetworkAddress m_serverAddress;
|
NetworkAddress m_serverAddress;
|
||||||
ISocketFactory* m_socketFactory;
|
ISocketFactory* m_socketFactory;
|
||||||
IStreamFilterFactory*
|
|
||||||
m_streamFilterFactory;
|
|
||||||
synergy::Screen* m_screen;
|
synergy::Screen* m_screen;
|
||||||
synergy::IStream* m_stream;
|
synergy::IStream* m_stream;
|
||||||
EventQueueTimer* m_timer;
|
EventQueueTimer* m_timer;
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
/*
|
|
||||||
* synergy -- mouse and keyboard sharing utility
|
|
||||||
* Copyright (C) 2012 Synergy Si Ltd.
|
|
||||||
* Copyright (C) 2002 Chris Schoeneman
|
|
||||||
*
|
|
||||||
* This package is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* found in the file COPYING that should have accompanied this file.
|
|
||||||
*
|
|
||||||
* This package 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 program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "common/IInterface.h"
|
|
||||||
|
|
||||||
namespace synergy { class IStream; }
|
|
||||||
|
|
||||||
//! Stream filter factory interface
|
|
||||||
/*!
|
|
||||||
This interface provides factory methods to create stream filters.
|
|
||||||
*/
|
|
||||||
class IStreamFilterFactory : public IInterface {
|
|
||||||
public:
|
|
||||||
//! Create filter
|
|
||||||
/*!
|
|
||||||
Create and return a stream filter on \p stream. The caller must
|
|
||||||
delete the returned object.
|
|
||||||
*/
|
|
||||||
virtual synergy::IStream*
|
|
||||||
create(synergy::IStream* stream, bool adoptStream) = 0;
|
|
||||||
};
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include "net/XSocket.h"
|
#include "net/XSocket.h"
|
||||||
#include "io/CryptoStream.h"
|
#include "io/CryptoStream.h"
|
||||||
#include "io/CryptoOptions.h"
|
#include "io/CryptoOptions.h"
|
||||||
#include "io/IStreamFilterFactory.h"
|
|
||||||
#include "base/Log.h"
|
#include "base/Log.h"
|
||||||
#include "base/IEventQueue.h"
|
#include "base/IEventQueue.h"
|
||||||
#include "base/TMethodEventJob.h"
|
#include "base/TMethodEventJob.h"
|
||||||
|
@ -44,11 +43,9 @@ static const char s_networkSecurity[] = { "libns" };
|
||||||
|
|
||||||
ClientListener::ClientListener(const NetworkAddress& address,
|
ClientListener::ClientListener(const NetworkAddress& address,
|
||||||
ISocketFactory* socketFactory,
|
ISocketFactory* socketFactory,
|
||||||
IStreamFilterFactory* streamFilterFactory,
|
|
||||||
const CryptoOptions& crypto,
|
const CryptoOptions& crypto,
|
||||||
IEventQueue* events) :
|
IEventQueue* events) :
|
||||||
m_socketFactory(socketFactory),
|
m_socketFactory(socketFactory),
|
||||||
m_streamFilterFactory(streamFilterFactory),
|
|
||||||
m_server(NULL),
|
m_server(NULL),
|
||||||
m_crypto(crypto),
|
m_crypto(crypto),
|
||||||
m_events(events)
|
m_events(events)
|
||||||
|
@ -67,13 +64,11 @@ ClientListener::ClientListener(const NetworkAddress& address,
|
||||||
catch (XSocketAddressInUse&) {
|
catch (XSocketAddressInUse&) {
|
||||||
cleanupListenSocket();
|
cleanupListenSocket();
|
||||||
delete m_socketFactory;
|
delete m_socketFactory;
|
||||||
delete m_streamFilterFactory;
|
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
catch (XBase&) {
|
catch (XBase&) {
|
||||||
cleanupListenSocket();
|
cleanupListenSocket();
|
||||||
delete m_socketFactory;
|
delete m_socketFactory;
|
||||||
delete m_streamFilterFactory;
|
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
LOG((CLOG_DEBUG1 "listening for clients"));
|
LOG((CLOG_DEBUG1 "listening for clients"));
|
||||||
|
@ -111,7 +106,6 @@ ClientListener::~ClientListener()
|
||||||
m_events->removeHandler(m_events->forIListenSocket().connecting(), m_listen);
|
m_events->removeHandler(m_events->forIListenSocket().connecting(), m_listen);
|
||||||
cleanupListenSocket();
|
cleanupListenSocket();
|
||||||
delete m_socketFactory;
|
delete m_socketFactory;
|
||||||
delete m_streamFilterFactory;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -144,9 +138,6 @@ ClientListener::handleClientConnecting(const Event&, void*)
|
||||||
LOG((CLOG_NOTE "accepted client connection"));
|
LOG((CLOG_NOTE "accepted client connection"));
|
||||||
|
|
||||||
// filter socket messages, including a packetizing filter
|
// filter socket messages, including a packetizing filter
|
||||||
if (m_streamFilterFactory != NULL) {
|
|
||||||
stream = m_streamFilterFactory->create(stream, true);
|
|
||||||
}
|
|
||||||
stream = new PacketStreamFilter(m_events, stream, true);
|
stream = new PacketStreamFilter(m_events, stream, true);
|
||||||
|
|
||||||
if (m_crypto.m_mode != kDisabled) {
|
if (m_crypto.m_mode != kDisabled) {
|
||||||
|
|
|
@ -30,7 +30,6 @@ class ClientProxyUnknown;
|
||||||
class NetworkAddress;
|
class NetworkAddress;
|
||||||
class IListenSocket;
|
class IListenSocket;
|
||||||
class ISocketFactory;
|
class ISocketFactory;
|
||||||
class IStreamFilterFactory;
|
|
||||||
class Server;
|
class Server;
|
||||||
class IEventQueue;
|
class IEventQueue;
|
||||||
|
|
||||||
|
@ -39,7 +38,6 @@ public:
|
||||||
// The factories are adopted.
|
// The factories are adopted.
|
||||||
ClientListener(const NetworkAddress&,
|
ClientListener(const NetworkAddress&,
|
||||||
ISocketFactory*,
|
ISocketFactory*,
|
||||||
IStreamFilterFactory*,
|
|
||||||
const CryptoOptions& crypto,
|
const CryptoOptions& crypto,
|
||||||
IEventQueue* events);
|
IEventQueue* events);
|
||||||
~ClientListener();
|
~ClientListener();
|
||||||
|
@ -81,8 +79,6 @@ private:
|
||||||
|
|
||||||
IListenSocket* m_listen;
|
IListenSocket* m_listen;
|
||||||
ISocketFactory* m_socketFactory;
|
ISocketFactory* m_socketFactory;
|
||||||
IStreamFilterFactory*
|
|
||||||
m_streamFilterFactory;
|
|
||||||
NewClients m_newClients;
|
NewClients m_newClients;
|
||||||
WaitingClients m_waitingClients;
|
WaitingClients m_waitingClients;
|
||||||
Server* m_server;
|
Server* m_server;
|
||||||
|
|
|
@ -341,7 +341,6 @@ ClientApp::openClient(const String& name, const NetworkAddress& address,
|
||||||
name,
|
name,
|
||||||
address,
|
address,
|
||||||
new TCPSocketFactory(m_events, getSocketMultiplexer()),
|
new TCPSocketFactory(m_events, getSocketMultiplexer()),
|
||||||
NULL,
|
|
||||||
screen,
|
screen,
|
||||||
crypto,
|
crypto,
|
||||||
args().m_enableDragDrop);
|
args().m_enableDragDrop);
|
||||||
|
|
|
@ -632,7 +632,6 @@ ServerApp::openClientListener(const NetworkAddress& address)
|
||||||
ClientListener* listen = new ClientListener(
|
ClientListener* listen = new ClientListener(
|
||||||
address,
|
address,
|
||||||
new TCPSocketFactory(m_events, getSocketMultiplexer()),
|
new TCPSocketFactory(m_events, getSocketMultiplexer()),
|
||||||
NULL,
|
|
||||||
args().m_crypto,
|
args().m_crypto,
|
||||||
m_events);
|
m_events);
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ TEST_F(NetworkTests, sendToClient_mockData)
|
||||||
// server
|
// server
|
||||||
SocketMultiplexer serverSocketMultiplexer;
|
SocketMultiplexer serverSocketMultiplexer;
|
||||||
TCPSocketFactory* serverSocketFactory = new TCPSocketFactory(&m_events, &serverSocketMultiplexer);
|
TCPSocketFactory* serverSocketFactory = new TCPSocketFactory(&m_events, &serverSocketMultiplexer);
|
||||||
ClientListener listener(serverAddress, serverSocketFactory, NULL, cryptoOptions, &m_events);
|
ClientListener listener(serverAddress, serverSocketFactory, cryptoOptions, &m_events);
|
||||||
NiceMock<MockScreen> serverScreen;
|
NiceMock<MockScreen> serverScreen;
|
||||||
NiceMock<MockPrimaryClient> primaryClient;
|
NiceMock<MockPrimaryClient> primaryClient;
|
||||||
NiceMock<MockConfig> serverConfig;
|
NiceMock<MockConfig> serverConfig;
|
||||||
|
@ -142,7 +142,7 @@ TEST_F(NetworkTests, sendToClient_mockData)
|
||||||
ON_CALL(clientScreen, getShape(_, _, _, _)).WillByDefault(Invoke(getScreenShape));
|
ON_CALL(clientScreen, getShape(_, _, _, _)).WillByDefault(Invoke(getScreenShape));
|
||||||
ON_CALL(clientScreen, getCursorPos(_, _)).WillByDefault(Invoke(getCursorPos));
|
ON_CALL(clientScreen, getCursorPos(_, _)).WillByDefault(Invoke(getCursorPos));
|
||||||
|
|
||||||
Client client(&m_events, "stub", serverAddress, clientSocketFactory, NULL, &clientScreen, cryptoOptions, true);
|
Client client(&m_events, "stub", serverAddress, clientSocketFactory, &clientScreen, cryptoOptions, true);
|
||||||
|
|
||||||
m_events.adoptHandler(
|
m_events.adoptHandler(
|
||||||
m_events.forIScreen().fileRecieveCompleted(), &client,
|
m_events.forIScreen().fileRecieveCompleted(), &client,
|
||||||
|
@ -169,7 +169,7 @@ TEST_F(NetworkTests, sendToClient_mockFile)
|
||||||
// server
|
// server
|
||||||
SocketMultiplexer serverSocketMultiplexer;
|
SocketMultiplexer serverSocketMultiplexer;
|
||||||
TCPSocketFactory* serverSocketFactory = new TCPSocketFactory(&m_events, &serverSocketMultiplexer);
|
TCPSocketFactory* serverSocketFactory = new TCPSocketFactory(&m_events, &serverSocketMultiplexer);
|
||||||
ClientListener listener(serverAddress, serverSocketFactory, NULL, cryptoOptions, &m_events);
|
ClientListener listener(serverAddress, serverSocketFactory, cryptoOptions, &m_events);
|
||||||
NiceMock<MockScreen> serverScreen;
|
NiceMock<MockScreen> serverScreen;
|
||||||
NiceMock<MockPrimaryClient> primaryClient;
|
NiceMock<MockPrimaryClient> primaryClient;
|
||||||
NiceMock<MockConfig> serverConfig;
|
NiceMock<MockConfig> serverConfig;
|
||||||
|
@ -195,7 +195,7 @@ TEST_F(NetworkTests, sendToClient_mockFile)
|
||||||
ON_CALL(clientScreen, getShape(_, _, _, _)).WillByDefault(Invoke(getScreenShape));
|
ON_CALL(clientScreen, getShape(_, _, _, _)).WillByDefault(Invoke(getScreenShape));
|
||||||
ON_CALL(clientScreen, getCursorPos(_, _)).WillByDefault(Invoke(getCursorPos));
|
ON_CALL(clientScreen, getCursorPos(_, _)).WillByDefault(Invoke(getCursorPos));
|
||||||
|
|
||||||
Client client(&m_events, "stub", serverAddress, clientSocketFactory, NULL, &clientScreen, cryptoOptions, true);
|
Client client(&m_events, "stub", serverAddress, clientSocketFactory, &clientScreen, cryptoOptions, true);
|
||||||
|
|
||||||
m_events.adoptHandler(
|
m_events.adoptHandler(
|
||||||
m_events.forIScreen().fileRecieveCompleted(), &client,
|
m_events.forIScreen().fileRecieveCompleted(), &client,
|
||||||
|
@ -222,7 +222,7 @@ TEST_F(NetworkTests, sendToServer_mockData)
|
||||||
// server
|
// server
|
||||||
SocketMultiplexer serverSocketMultiplexer;
|
SocketMultiplexer serverSocketMultiplexer;
|
||||||
TCPSocketFactory* serverSocketFactory = new TCPSocketFactory(&m_events, &serverSocketMultiplexer);
|
TCPSocketFactory* serverSocketFactory = new TCPSocketFactory(&m_events, &serverSocketMultiplexer);
|
||||||
ClientListener listener(serverAddress, serverSocketFactory, NULL, cryptoOptions, &m_events);
|
ClientListener listener(serverAddress, serverSocketFactory, cryptoOptions, &m_events);
|
||||||
NiceMock<MockScreen> serverScreen;
|
NiceMock<MockScreen> serverScreen;
|
||||||
NiceMock<MockPrimaryClient> primaryClient;
|
NiceMock<MockPrimaryClient> primaryClient;
|
||||||
NiceMock<MockConfig> serverConfig;
|
NiceMock<MockConfig> serverConfig;
|
||||||
|
@ -243,7 +243,7 @@ TEST_F(NetworkTests, sendToServer_mockData)
|
||||||
ON_CALL(clientScreen, getShape(_, _, _, _)).WillByDefault(Invoke(getScreenShape));
|
ON_CALL(clientScreen, getShape(_, _, _, _)).WillByDefault(Invoke(getScreenShape));
|
||||||
ON_CALL(clientScreen, getCursorPos(_, _)).WillByDefault(Invoke(getCursorPos));
|
ON_CALL(clientScreen, getCursorPos(_, _)).WillByDefault(Invoke(getCursorPos));
|
||||||
|
|
||||||
Client client(&m_events, "stub", serverAddress, clientSocketFactory, NULL, &clientScreen, cryptoOptions, true);
|
Client client(&m_events, "stub", serverAddress, clientSocketFactory, &clientScreen, cryptoOptions, true);
|
||||||
|
|
||||||
m_events.adoptHandler(
|
m_events.adoptHandler(
|
||||||
m_events.forClientListener().connected(), &listener,
|
m_events.forClientListener().connected(), &listener,
|
||||||
|
@ -275,7 +275,7 @@ TEST_F(NetworkTests, sendToServer_mockFile)
|
||||||
// server
|
// server
|
||||||
SocketMultiplexer serverSocketMultiplexer;
|
SocketMultiplexer serverSocketMultiplexer;
|
||||||
TCPSocketFactory* serverSocketFactory = new TCPSocketFactory(&m_events, &serverSocketMultiplexer);
|
TCPSocketFactory* serverSocketFactory = new TCPSocketFactory(&m_events, &serverSocketMultiplexer);
|
||||||
ClientListener listener(serverAddress, serverSocketFactory, NULL, cryptoOptions, &m_events);
|
ClientListener listener(serverAddress, serverSocketFactory, cryptoOptions, &m_events);
|
||||||
NiceMock<MockScreen> serverScreen;
|
NiceMock<MockScreen> serverScreen;
|
||||||
NiceMock<MockPrimaryClient> primaryClient;
|
NiceMock<MockPrimaryClient> primaryClient;
|
||||||
NiceMock<MockConfig> serverConfig;
|
NiceMock<MockConfig> serverConfig;
|
||||||
|
@ -296,7 +296,7 @@ TEST_F(NetworkTests, sendToServer_mockFile)
|
||||||
ON_CALL(clientScreen, getShape(_, _, _, _)).WillByDefault(Invoke(getScreenShape));
|
ON_CALL(clientScreen, getShape(_, _, _, _)).WillByDefault(Invoke(getScreenShape));
|
||||||
ON_CALL(clientScreen, getCursorPos(_, _)).WillByDefault(Invoke(getCursorPos));
|
ON_CALL(clientScreen, getCursorPos(_, _)).WillByDefault(Invoke(getCursorPos));
|
||||||
|
|
||||||
Client client(&m_events, "stub", serverAddress, clientSocketFactory, NULL, &clientScreen, cryptoOptions, true);
|
Client client(&m_events, "stub", serverAddress, clientSocketFactory, &clientScreen, cryptoOptions, true);
|
||||||
|
|
||||||
m_events.adoptHandler(
|
m_events.adoptHandler(
|
||||||
m_events.forClientListener().connected(), &listener,
|
m_events.forClientListener().connected(), &listener,
|
||||||
|
|
Loading…
Reference in New Issue