Fix satellite disconnect loop: parent now sends hello reply
The parent SatelliteLink never sent a hello reply after authenticating the satellite client. This caused two problems: 1. The satellite client's m_hello_received stayed false, preventing it from forwarding any local events to the parent. 2. No parent→satellite traffic until the first heartbeat at ~10s, allowing intermediate firewalls/NAT to kill the idle connection (observed as ~7s disconnect-after-auth loops). Send a MsgTrunkHello reply from the parent, matching what TrunkLink already does for trunk peers. Update tests for two-way handshake.
This commit is contained in:
1 parent
76c2afc084
commit
8b6148a678
3 files changed
+15
-4
No files matched your search
@@ -182,6 +182,13 @@ void SatelliteLink::handleMsgTrunkHello(std::istream& is)
|
||||
|
||||
cout << "SAT: Satellite '" << m_satellite_id
|
||||
<< "' authenticated" << endl;
|
||||
|
||||
// Send hello reply so the satellite client can set m_hello_received
|
||||
// and start forwarding local events. This also generates early
|
||||
// parent→satellite traffic, keeping the connection alive through
|
||||
// firewalls / NAT devices that drop idle TCP sessions.
|
||||
sendMsg(MsgTrunkHello("PARENT", "", 0, m_secret,
|
||||
MsgTrunkHello::ROLE_PEER));
|
||||
} /* SatelliteLink::handleMsgTrunkHello */
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user