mirror of
https://github.com/status-im/miniupnp.git
synced 2025-02-20 09:48:26 +00:00
Return 730 error where appropriate, and output helpful debug
This commit is contained in:
parent
20f1e070a1
commit
f27dd45973
@ -772,12 +772,23 @@ DeletePortMappingRange(struct upnphttp * h, const char * action)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
syslog(LOG_INFO, "%s: deleting external ports: %hu-%hu, protocol: %s",
|
||||||
|
action, startport, endport, protocol);
|
||||||
|
|
||||||
port_list = upnp_get_portmappings_in_range(startport, endport,
|
port_list = upnp_get_portmappings_in_range(startport, endport,
|
||||||
protocol, &number);
|
protocol, &number);
|
||||||
|
if(number == 0)
|
||||||
|
{
|
||||||
|
SoapError(h, 730, "PortMappingNotFound");
|
||||||
|
ClearNameValueList(&data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for(i = 0; i < number; i++)
|
for(i = 0; i < number; i++)
|
||||||
{
|
{
|
||||||
r = upnp_delete_redirection(port_list[i], protocol);
|
r = upnp_delete_redirection(port_list[i], protocol);
|
||||||
/* TODO : check return value for errors */
|
syslog(LOG_INFO, "%s: deleting external port: %hu, protocol: %s: %s",
|
||||||
|
action, port_list[i], protocol, r < 0 ? "failed" : "ok");
|
||||||
}
|
}
|
||||||
free(port_list);
|
free(port_list);
|
||||||
BuildSendAndCloseSoapResp(h, resp, sizeof(resp)-1);
|
BuildSendAndCloseSoapResp(h, resp, sizeof(resp)-1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user