Rename getDestination to getYourAddressAndport

feature/IPV6_#35_Reboot
Geoffrey Merck 2 years ago
parent 10fcb16b3e
commit 4bd7345e85

@ -80,7 +80,7 @@ bool CG2ProtocolHandler::writeAMBE(const CAMBEData& data)
CUtils::dump("Sending Data", buffer, length);
#endif
assert(CNetUtils::match(data.getDestination(), m_address, IMT_ADDRESS_ONLY));
assert(CNetUtils::match(data.getYourAddressAndPort(), m_address, IMT_ADDRESS_ONLY));
//CLog::logTrace("Write ambe to %s:%u", inet_ntoa(addr), ntohs(TOIPV4(m_address)->sin_port));
return m_socket->write(buffer, length, m_address);
}

@ -141,12 +141,12 @@ bool CG2ProtocolHandlerPool::writeHeader(const CHeaderData& header)
bool CG2ProtocolHandlerPool::writeAMBE(const CAMBEData& data)
{
auto handler = findHandler(data.getDestination(), IMT_ADDRESS_AND_PORT);
auto handler = findHandler(data.getYourAddressAndPort(), IMT_ADDRESS_AND_PORT);
if(handler == nullptr)
handler = findHandler(data.getDestination(), IMT_ADDRESS_ONLY);
handler = findHandler(data.getYourAddressAndPort(), IMT_ADDRESS_ONLY);
if(handler == nullptr) {
handler = new CG2ProtocolHandler(&m_socket, data.getDestination(), G2_BUFFER_LENGTH);
handler = new CG2ProtocolHandler(&m_socket, data.getYourAddressAndPort(), G2_BUFFER_LENGTH);
m_pool.push_back(handler);
m_index = m_pool.end();
}

@ -583,7 +583,7 @@ unsigned int CAMBEData::getMyPort() const
return m_myPort;
}
struct sockaddr_storage CAMBEData::getDestination() const
struct sockaddr_storage CAMBEData::getYourAddressAndPort() const
{
struct sockaddr_storage dest;
::memset(&dest, 0, sizeof(sockaddr_storage));

@ -77,7 +77,7 @@ public:
in_addr getYourAddress() const;
unsigned int getYourPort() const;
struct sockaddr_storage getDestination() const;
struct sockaddr_storage getYourAddressAndPort() const;
unsigned int getMyPort() const;
unsigned int getErrors() const;

Loading…
Cancel
Save

Powered by TurnKey Linux.