REFAC(server): Removed dead code msgUDPTunnel

This message type is explicitly handled before calling into the
different msg* implementations. Therefore, msgUDPTunnel could never be
called in the current state of the code base.

However, we can't remove the implementation completely, because of the
macro voodoo that is used to declare and switch over the different
message types (we can't remove the entry from the macro, since in there
we still need it for defining the respective enum entry).
This commit is contained in:
Robert Adam 2021-12-14 10:53:57 +01:00
parent 1017dab5c2
commit 7d4dcd168d

View File

@ -635,23 +635,10 @@ void Server::msgServerSync(ServerUser *, MumbleProto::ServerSync &) {
void Server::msgPermissionDenied(ServerUser *, MumbleProto::PermissionDenied &) {
}
void Server::msgUDPTunnel(ServerUser *uSource, MumbleProto::UDPTunnel &msg) {
ZoneScoped;
MSG_SETUP_NO_UNIDLE(ServerUser::Authenticated);
const std::string &str = msg.packet();
int len = static_cast< int >(str.length());
if (len < 1)
return;
QReadLocker rl(&qrwlVoiceThread);
if (m_tcpTunnelDecoder.decode(gsl::span< const Mumble::Protocol::byte >(
reinterpret_cast< const Mumble::Protocol::byte * >(str.data()), str.size()))
&& m_tcpTunnelDecoder.getMessageType() == Mumble::Protocol::UDPMessageType::Audio) {
Mumble::Protocol::AudioData audioData = m_tcpTunnelDecoder.getAudioData();
processMsg(uSource, audioData, m_tcpAudioReceivers, m_tcpAudioEncoder);
}
void Server::msgUDPTunnel(ServerUser *, MumbleProto::UDPTunnel &) {
// This code should be unreachable
assert(false);
qWarning("Messages: Reached theoretically unreachable function msgUDPTunnel");
}
void Server::msgUserState(ServerUser *uSource, MumbleProto::UserState &msg) {