Skip to content

Commit

Permalink
Rename getDestination to getYourAddressAndport
Browse files Browse the repository at this point in the history
  • Loading branch information
F4FXL committed Dec 2, 2023
1 parent 10fcb16 commit 4bd7345
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Common/G2ProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions Common/G2ProtocolHandlerPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion DStarBase/AMBEData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion DStarBase/AMBEData.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class CAMBEData {

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;
Expand Down

0 comments on commit 4bd7345

Please sign in to comment.