Ignore duplicate hello on inbound trunk connection
handleMsgTrunkHello was called for hellos arriving on both outbound and inbound connections. Inbound hellos are already handled by acceptInboundConnection, so a second one arriving via onFrameReceived (e.g. from TcpPrioClient background reconnect) is a duplicate. Silently ignore it instead of printing a misleading double hello log.
This commit is contained in:
1 parent
be4d3b99c5
commit
175cb15254
2 files changed
+16
-3
No files matched your search
@@ -590,7 +590,7 @@ void TrunkLink::onFrameReceived(FramedTcpConnection* con,
|
||||
handleMsgTrunkHeartbeat();
|
||||
break;
|
||||
case MsgTrunkHello::TYPE:
|
||||
handleMsgTrunkHello(ss);
|
||||
handleMsgTrunkHello(ss, is_inbound);
|
||||
break;
|
||||
case MsgTrunkTalkerStart::TYPE:
|
||||
handleMsgTrunkTalkerStart(ss);
|
||||
@@ -618,8 +618,21 @@ void TrunkLink::handleMsgTrunkHeartbeat(void)
|
||||
} /* TrunkLink::handleMsgTrunkHeartbeat */
|
||||
|
||||
|
||||
void TrunkLink::handleMsgTrunkHello(std::istream& is)
|
||||
void TrunkLink::handleMsgTrunkHello(std::istream& is, bool is_inbound)
|
||||
{
|
||||
// Inbound hellos are already handled by acceptInboundConnection.
|
||||
// A duplicate arriving here means the peer re-sent (e.g. TcpPrioClient
|
||||
// background reconnect) — ignore it silently.
|
||||
if (is_inbound)
|
||||
{
|
||||
if (m_debug)
|
||||
{
|
||||
cout << m_section << " [DEBUG]: ignoring duplicate hello on inbound"
|
||||
<< endl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Hello on outbound = peer's reply to our outbound hello
|
||||
MsgTrunkHello msg;
|
||||
if (!msg.unpack(is))
|
||||
|
||||
@@ -187,7 +187,7 @@ class TrunkLink : public sigc::trackable
|
||||
void onFrameReceived(Async::FramedTcpConnection* con,
|
||||
std::vector<uint8_t>& data);
|
||||
|
||||
void handleMsgTrunkHello(std::istream& is);
|
||||
void handleMsgTrunkHello(std::istream& is, bool is_inbound);
|
||||
void handleMsgTrunkTalkerStart(std::istream& is);
|
||||
void handleMsgTrunkTalkerStop(std::istream& is);
|
||||
void handleMsgTrunkAudio(std::istream& is);
|
||||
|
||||
Reference in new issue
Block a user