mirror of
https://github.com/debauchee/barrier.git
synced 2026-07-16 19:10:39 +08:00
removed client connection when SSL handshake failed #4313
This commit is contained in:
@@ -188,6 +188,7 @@ ClientListener::handleUnknownClient(const Event&, void* vclient)
|
||||
|
||||
// get the real client proxy and install it
|
||||
ClientProxy* client = unknownClient->orphanClientProxy();
|
||||
bool handshakeOk = true;
|
||||
if (client != NULL) {
|
||||
// handshake was successful
|
||||
m_waitingClients.push_back(client);
|
||||
@@ -199,12 +200,25 @@ ClientListener::handleUnknownClient(const Event&, void* vclient)
|
||||
&ClientListener::handleClientDisconnected,
|
||||
client));
|
||||
}
|
||||
else {
|
||||
handshakeOk = false;
|
||||
}
|
||||
|
||||
// now finished with unknown client
|
||||
m_events->removeHandler(m_events->forClientProxyUnknown().success(), client);
|
||||
m_events->removeHandler(m_events->forClientProxyUnknown().failure(), client);
|
||||
m_newClients.erase(unknownClient);
|
||||
PacketStreamFilter* streamFileter = dynamic_cast<PacketStreamFilter*>(unknownClient->getStream());
|
||||
IDataSocket* socket = NULL;
|
||||
if (streamFileter != NULL) {
|
||||
socket = dynamic_cast<IDataSocket*>(streamFileter->getStream());
|
||||
}
|
||||
|
||||
delete unknownClient;
|
||||
|
||||
if (m_useSecureNetwork && !handshakeOk) {
|
||||
deleteSocket(socket);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -43,6 +43,9 @@ public:
|
||||
*/
|
||||
ClientProxy* orphanClientProxy();
|
||||
|
||||
//! Get the stream
|
||||
synergy::IStream* getStream() { return m_stream; }
|
||||
|
||||
//@}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user