debug a STUN reponse that only changes port

This commit is contained in:
Stephen Birarda 2013-10-18 15:27:35 -07:00
parent 32680bbaad
commit 0dd16cfc1e

View file

@ -409,7 +409,7 @@ void NodeList::processSTUNResponse(unsigned char* packetData, size_t dataBytes)
uint16_t xorMappedPort = 0;
memcpy(&xorMappedPort, packetData + byteIndex, sizeof(xorMappedPort));
_publicPort = ntohs(xorMappedPort) ^ (ntohl(RFC_5389_MAGIC_COOKIE_NETWORK_ORDER) >> 16);
uint16_t newPublicPort = ntohs(xorMappedPort) ^ (ntohl(RFC_5389_MAGIC_COOKIE_NETWORK_ORDER) >> 16);
byteIndex += sizeof(xorMappedPort);
@ -421,8 +421,9 @@ void NodeList::processSTUNResponse(unsigned char* packetData, size_t dataBytes)
QHostAddress newPublicAddress = QHostAddress(stunAddress);
if (newPublicAddress != _publicAddress) {
if (newPublicAddress != _publicAddress || newPublicPort != _publicPort) {
_publicAddress = newPublicAddress;
_publicPort = newPublicPort;
qDebug("New public socket received from STUN server is %s:%hu\n",
_publicAddress.toString().toLocal8Bit().constData(),