Merge pull request #4604

0fbbb065 p2p: a negative result from UPNP_GetValidIGD is an error (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2018-10-26 22:35:50 +02:00
commit 481d7ed147
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD

View file

@ -2042,7 +2042,7 @@ namespace nodetool
char lanAddress[64]; char lanAddress[64];
result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress); result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress);
freeUPNPDevlist(deviceList); freeUPNPDevlist(deviceList);
if (result != 0) { if (result > 0) {
if (result == 1) { if (result == 1) {
std::ostringstream portString; std::ostringstream portString;
portString << port; portString << port;
@ -2088,7 +2088,7 @@ namespace nodetool
char lanAddress[64]; char lanAddress[64];
result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress); result = UPNP_GetValidIGD(deviceList, &urls, &igdData, lanAddress, sizeof lanAddress);
freeUPNPDevlist(deviceList); freeUPNPDevlist(deviceList);
if (result != 0) { if (result > 0) {
if (result == 1) { if (result == 1) {
std::ostringstream portString; std::ostringstream portString;
portString << port; portString << port;