mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
always remove old socket-matching node before add
This commit is contained in:
parent
cb4ce4fedb
commit
d8b5a1a4a6
1 changed files with 8 additions and 12 deletions
|
@ -463,19 +463,15 @@ SharedNodePointer DomainGatekeeper::processAgentConnectRequest(const NodeConnect
|
||||||
limitedNodeList->eachNodeBreakable([nodeConnection, username, &existingNodeID](const SharedNodePointer& node){
|
limitedNodeList->eachNodeBreakable([nodeConnection, username, &existingNodeID](const SharedNodePointer& node){
|
||||||
|
|
||||||
if (node->getPublicSocket() == nodeConnection.publicSockAddr && node->getLocalSocket() == nodeConnection.localSockAddr) {
|
if (node->getPublicSocket() == nodeConnection.publicSockAddr && node->getLocalSocket() == nodeConnection.localSockAddr) {
|
||||||
// we have a node that already has these exact sockets - this can occur if a node
|
// we have a node that already has these exact sockets
|
||||||
// is failing to connect to the domain
|
// this can occur if a node is failing to connect to the domain
|
||||||
|
|
||||||
// we'll re-use the existing node ID
|
// remove the old node before adding the new node
|
||||||
// as long as the user hasn't changed their username (by logging in or logging out)
|
qDebug() << "Deleting existing connection from same sockaddr: " << node->getUUID();
|
||||||
auto existingNodeData = static_cast<DomainServerNodeData*>(node->getLinkedData());
|
existingNodeID = node->getUUID();
|
||||||
|
return false;
|
||||||
if (existingNodeData->getUsername() == username) {
|
|
||||||
qDebug() << "Deleting existing connection from same sockaddr: " << node->getUUID();
|
|
||||||
existingNodeID = node->getUUID();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue