@@ -130,8 +130,8 @@ QString CServerListEntry::toCSV()
130130{
131131 QStringList sl;
132132
133- sl.append ( this ->HostAddr .toString () );
134- sl.append ( this ->LHostAddr .toString () );
133+ sl.append ( this ->HostAddr4 .toString () );
134+ sl.append ( this ->LHostAddr4 .toString () );
135135 sl.append ( ToBase64 ( this ->strName ) );
136136 sl.append ( ToBase64 ( this ->strCity ) );
137137 sl.append ( QString::number ( this ->eCountry ) );
@@ -543,7 +543,7 @@ void CServerListManager::OnTimerPingServerInList()
543543 for ( int iIdx = 1 ; iIdx < iCurServerListSize; iIdx++ )
544544 {
545545 // send empty message to keep NAT port open at registered server
546- pConnLessProtocol->CreateCLEmptyMes ( ServerList[iIdx].HostAddr );
546+ pConnLessProtocol->CreateCLEmptyMes ( ServerList[iIdx].HostAddr4 );
547547 }
548548}
549549
@@ -560,7 +560,7 @@ void CServerListManager::OnTimerPollList()
560560 if ( ServerList[iIdx].RegisterTime .elapsed () > ( SERVLIST_TIME_OUT_MINUTES * 60000 ) )
561561 {
562562 // remove this list entry
563- vecRemovedHostAddr.Add ( ServerList[iIdx].HostAddr );
563+ vecRemovedHostAddr.Add ( ServerList[iIdx].HostAddr4 );
564564 ServerList.removeAt ( iIdx );
565565 }
566566 }
@@ -637,7 +637,7 @@ void CServerListManager::Append ( const CHostAddress& InetAddr,
637637 else
638638 {
639639 // update all data and call update registration function
640- ServerList[iSelIdx].LHostAddr = LInetAddr;
640+ ServerList[iSelIdx].LHostAddr4 = LInetAddr;
641641 ServerList[iSelIdx].strName = ServerInfo.strName ;
642642 ServerList[iSelIdx].eCountry = ServerInfo.eCountry ;
643643 ServerList[iSelIdx].strCity = ServerInfo.strCity ;
@@ -695,12 +695,12 @@ void CServerListManager::RetrieveAll ( const CHostAddress& InetAddr )
695695 bool clientIsInternal = NetworkUtil::IsPrivateNetworkIP ( InetAddr.InetAddr );
696696
697697 CHostAddress clientPublicAddr = InetAddr;
698- if ( clientIsInternal && CHostAddress ().InetAddr != ServerList[0 ].LHostAddr .InetAddr &&
699- !NetworkUtil::IsPrivateNetworkIP ( ServerList[0 ].LHostAddr .InetAddr ) )
698+ if ( clientIsInternal && CHostAddress ().InetAddr != ServerList[0 ].LHostAddr4 .InetAddr &&
699+ !NetworkUtil::IsPrivateNetworkIP ( ServerList[0 ].LHostAddr4 .InetAddr ) )
700700 {
701701 // client and directory on same LAN, directory has public IP set, that should be suitable for the
702702 // client, too (i.e. same router with same public IP will be used for both), so use it for client public IP
703- clientPublicAddr.InetAddr = ServerList[0 ].LHostAddr .InetAddr ;
703+ clientPublicAddr.InetAddr = ServerList[0 ].LHostAddr4 .InetAddr ;
704704 }
705705
706706 const ushort iCurServerListSize = static_cast <ushort> ( ServerList.size () );
@@ -709,8 +709,8 @@ void CServerListManager::RetrieveAll ( const CHostAddress& InetAddr )
709709 CVector<CServerInfo> vecServerInfo ( iCurServerListSize );
710710
711711 // copy list item for the directory and just let the protocol sort out the actual details
712- vecServerInfo[0 ] = ServerList[0 ];
713- vecServerInfo[0 ].HostAddr = CHostAddress ();
712+ vecServerInfo[0 ] = ServerList[0 ];
713+ vecServerInfo[0 ].HostAddr4 = CHostAddress ();
714714
715715 // copy the list (we have to copy it since the message requires a vector but the list is actually stored in a QList object
716716 // and not in a vector object)
@@ -719,25 +719,25 @@ void CServerListManager::RetrieveAll ( const CHostAddress& InetAddr )
719719 // copy list item
720720 CServerInfo& siCurListEntry = vecServerInfo[iIdx] = ServerList[iIdx];
721721
722- bool serverIsInternal = NetworkUtil::IsPrivateNetworkIP ( siCurListEntry.HostAddr .InetAddr );
722+ bool serverIsInternal = NetworkUtil::IsPrivateNetworkIP ( siCurListEntry.HostAddr4 .InetAddr );
723723
724- bool wantHostAddr = clientIsInternal /* HostAddr is local IP if local server else external IP, so do not replace */ ||
724+ bool wantHostAddr = clientIsInternal /* HostAddr4 is local IP if local server else external IP, so do not replace */ ||
725725 ( !serverIsInternal &&
726- InetAddr.InetAddr != siCurListEntry.HostAddr .InetAddr /* external server and client have different public IPs */ );
726+ InetAddr.InetAddr != siCurListEntry.HostAddr4 .InetAddr /* external server and client have different public IPs */ );
727727
728728 if ( !wantHostAddr )
729729 {
730- vecServerInfo[iIdx].HostAddr = siCurListEntry.LHostAddr ;
730+ vecServerInfo[iIdx].HostAddr4 = siCurListEntry.LHostAddr4 ;
731731 }
732732
733733 // do not send a "ping" to a server local to the directory (no need)
734734 if ( !serverIsInternal )
735735 {
736736 // create "send empty message" for all other registered servers
737- // this causes the server (vecServerInfo[iIdx].HostAddr )
737+ // this causes the server (vecServerInfo[iIdx].HostAddr4 )
738738 // to send a "reply" to the client (InetAddr or best guess public IP address if internal to directory)
739739 // - with the intent of opening the server firewall for the client
740- pConnLessProtocol->CreateCLSendEmptyMesMes ( siCurListEntry.HostAddr , clientPublicAddr );
740+ pConnLessProtocol->CreateCLSendEmptyMesMes ( siCurListEntry.HostAddr4 , clientPublicAddr );
741741 }
742742 }
743743
@@ -758,7 +758,7 @@ int CServerListManager::IndexOf ( const CHostAddress& haSearchTerm )
758758 // (i.e., this server).
759759 for ( int iIdx = ServerList.size () - 1 ; iIdx > 0 ; iIdx-- )
760760 {
761- if ( ServerList[iIdx].HostAddr == haSearchTerm )
761+ if ( ServerList[iIdx].HostAddr4 == haSearchTerm )
762762 {
763763 return iIdx;
764764 }
@@ -847,15 +847,15 @@ bool CServerListManager::Load()
847847 pServer->IsIPv6Available () );
848848
849849 // We expect servers to have addresses...
850- if ( ( CHostAddress () == serverListEntry.HostAddr ) )
850+ if ( ( CHostAddress () == serverListEntry.HostAddr4 ) )
851851 {
852852 qWarning () << qUtf8Printable ( QString ( " Could not parse '%1' successfully - invalid host" ).arg ( line ) );
853853 continue ;
854854 }
855855
856856 qInfo () << qUtf8Printable ( QString ( " Loading registration for %1 (%2): %3" )
857- .arg ( serverListEntry.HostAddr .toString () )
858- .arg ( serverListEntry.LHostAddr .toString () )
857+ .arg ( serverListEntry.HostAddr4 .toString () )
858+ .arg ( serverListEntry.LHostAddr4 .toString () )
859859 .arg ( serverListEntry.strName ) );
860860 ServerList.append ( serverListEntry );
861861 }
@@ -889,8 +889,8 @@ void CServerListManager::Save()
889889 for ( int iIdx = ServerList.size () - 1 ; iIdx > 0 ; iIdx-- )
890890 {
891891 qInfo () << qUtf8Printable ( QString ( tr ( " Saving registration for %1 (%2): %3" ) )
892- .arg ( ServerList[iIdx].HostAddr .toString () )
893- .arg ( ServerList[iIdx].LHostAddr .toString () )
892+ .arg ( ServerList[iIdx].HostAddr4 .toString () )
893+ .arg ( ServerList[iIdx].LHostAddr4 .toString () )
894894 .arg ( ServerList[iIdx].strName ) );
895895 out << ServerList[iIdx].toCSV () << ' \n ' ;
896896 }
0 commit comments