diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp index b12f2a3cd..634f340dd 100644 --- a/src/lib/client/Client.cpp +++ b/src/lib/client/Client.cpp @@ -11,6 +11,7 @@ #include "arch/Arch.h" #include "base/IEventQueue.h" #include "base/Log.h" +#include "base/NetworkProtocol.h" #include "client/ServerProxy.h" #include "common/Settings.h" #include "deskflow/Clipboard.h" @@ -578,7 +579,8 @@ void Client::handleHello() std::string protocolName; ProtocolUtil::readf(m_stream, kMsgHello, &protocolName, &serverMajor, &serverMinor); - if (protocolName != kSynergyProtocolName && protocolName != kBarrierProtocolName) { + if (const auto proto = networkProtocolFromString(QString::fromStdString(protocolName)); + proto == NetworkProtocol::Unknown) { LOG_WARN("hello back received with protocol: '%s'", protocolName.c_str()); sendConnectionFailedEvent("got invalid hello message from server"); cleanupTimer(); diff --git a/src/lib/deskflow/ProtocolTypes.cpp b/src/lib/deskflow/ProtocolTypes.cpp index c47cd1cf2..17f4afc1e 100644 --- a/src/lib/deskflow/ProtocolTypes.cpp +++ b/src/lib/deskflow/ProtocolTypes.cpp @@ -7,11 +7,6 @@ #include "deskflow/ProtocolTypes.h" -// Protocol names used in network handshake messages (capitalized, must be exactly 7 chars). -// Note that @ref kSynergyProtocolOption / @ref kBarrierProtocolOption use lowercase names. -const char *const kSynergyProtocolName = "Synergy"; -const char *const kBarrierProtocolName = "Barrier"; - // The protocol name string within the hello and hello back messages must be // 7 chars for backward compatibility (Synergy and Barrier are 7 chars). const char *const kMsgHello = "%7s%2i%2i"; diff --git a/src/lib/deskflow/ProtocolTypes.h b/src/lib/deskflow/ProtocolTypes.h index 1e2129bad..44e27f3ad 100644 --- a/src/lib/deskflow/ProtocolTypes.h +++ b/src/lib/deskflow/ProtocolTypes.h @@ -202,26 +202,6 @@ enum class TransferState : uint8_t * @{ */ -/** - * @brief Protocol name for Synergy compatibility - * - * Used in handshake messages to identify the protocol as Synergy-compatible. - * Must be exactly 7 characters for backward compatibility. - * - * @since Protocol version 1.0 - */ -extern const char *const kSynergyProtocolName; - -/** - * @brief Protocol name for Barrier compatibility - * - * Used in handshake messages to identify the protocol as Barrier-compatible. - * Must be exactly 7 characters for backward compatibility. - * - * @since Protocol version 1.0 - */ -extern const char *const kBarrierProtocolName; - /** * @brief Server hello message *