send hostname to DS with every DS packet to handle changes

This commit is contained in:
Stephen Birarda 2016-05-10 13:47:14 -07:00
parent 962066c7d1
commit 5ab876114f
4 changed files with 10 additions and 9 deletions

View file

@ -55,9 +55,9 @@ void DomainGatekeeper::processConnectRequestPacket(QSharedPointer<ReceivedMessag
if (message->getSize() == 0) {
return;
}
QDataStream packetStream(message->getMessage());
// read a NodeConnectionData object from the packet so we can pass around this data while we're inspecting it
NodeConnectionData nodeConnection = NodeConnectionData::fromDataStream(packetStream, message->getSenderSockAddr());

View file

@ -678,6 +678,9 @@ void DomainServer::processListRequestPacket(QSharedPointer<ReceivedMessage> mess
DomainServerNodeData* nodeData = reinterpret_cast<DomainServerNodeData*>(sendingNode->getLinkedData());
nodeData->setNodeInterestSet(nodeRequestData.interestList.toSet());
// update the connecting hostname in case it has changed
nodeData->setPlaceName(nodeRequestData.placeName);
sendDomainListToNode(sendingNode, message->getSenderSockAddr());
}

View file

@ -19,12 +19,11 @@ NodeConnectionData NodeConnectionData::fromDataStream(QDataStream& dataStream, c
if (isConnectRequest) {
dataStream >> newHeader.connectUUID;
dataStream >> newHeader.placeName;
}
dataStream >> newHeader.nodeType
>> newHeader.publicSockAddr >> newHeader.localSockAddr
>> newHeader.interestList;
>> newHeader.interestList >> newHeader.placeName;
newHeader.senderSockAddr = senderSockAddr;

View file

@ -312,13 +312,12 @@ void NodeList::sendDomainServerCheckIn() {
// pack the connect UUID for this connect request
packetStream << connectUUID;
// pack the hostname information (so the domain-server can see which place name we came in on)
packetStream << DependencyManager::get<AddressManager>()->getPlaceName();
}
// pack our data to send to the domain-server
packetStream << _ownerType << _publicSockAddr << _localSockAddr << _nodeTypesOfInterest.toList();
// pack our data to send to the domain-server including
// the hostname information (so the domain-server can see which place name we came in on)
packetStream << _ownerType << _publicSockAddr << _localSockAddr << _nodeTypesOfInterest.toList()
<< DependencyManager::get<AddressManager>()->getPlaceName();
if (!_domainHandler.isConnected()) {
DataServerAccountInfo& accountInfo = accountManager->getAccountInfo();