AddPortMapping() now returns an error code

This commit is contained in:
Darexon 2017-02-15 00:01:41 -06:00
parent 859b986385
commit 2c262a8793
1 changed files with 3 additions and 1 deletions

View File

@ -292,9 +292,11 @@ static int SetRedirectAndTest(struct UPNPUrls * urls,
r = UPNP_AddPortMapping(urls->controlURL, data->first.servicetype, r = UPNP_AddPortMapping(urls->controlURL, data->first.servicetype,
eport, iport, iaddr, description, eport, iport, iaddr, description,
proto, 0, leaseDuration); proto, 0, leaseDuration);
if(r!=UPNPCOMMAND_SUCCESS) if(r!=UPNPCOMMAND_SUCCESS) {
printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n", printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n",
eport, iport, iaddr, r, strupnperror(r)); eport, iport, iaddr, r, strupnperror(r));
return -2;
}
} }
r = UPNP_GetSpecificPortMappingEntry(urls->controlURL, r = UPNP_GetSpecificPortMappingEntry(urls->controlURL,