Align formatting with clang-format
This commit is contained in:
parent
91a1b85083
commit
02709e9560
1 changed files with 12 additions and 16 deletions
28
src/net.cpp
28
src/net.cpp
|
@ -1423,36 +1423,32 @@ static void ThreadMapPort()
|
|||
if (fDiscover) {
|
||||
char externalIPAddress[40];
|
||||
r = UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIPAddress);
|
||||
if(r != UPNPCOMMAND_SUCCESS)
|
||||
if (r != UPNPCOMMAND_SUCCESS) {
|
||||
LogPrintf("UPnP: GetExternalIPAddress() returned %d\n", r);
|
||||
else
|
||||
{
|
||||
if(externalIPAddress[0])
|
||||
{
|
||||
} else {
|
||||
if (externalIPAddress[0]) {
|
||||
CNetAddr resolved;
|
||||
if(LookupHost(externalIPAddress, resolved, false)) {
|
||||
if (LookupHost(externalIPAddress, resolved, false)) {
|
||||
LogPrintf("UPnP: ExternalIPAddress = %s\n", resolved.ToString().c_str());
|
||||
AddLocal(resolved, LOCAL_UPNP);
|
||||
}
|
||||
}
|
||||
else
|
||||
} else {
|
||||
LogPrintf("UPnP: GetExternalIPAddress failed.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string strDesc = PACKAGE_NAME " " + FormatFullVersion();
|
||||
|
||||
do {
|
||||
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
|
||||
port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0, "0");
|
||||
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0, "0");
|
||||
|
||||
if(r!=UPNPCOMMAND_SUCCESS)
|
||||
LogPrintf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n",
|
||||
port, port, lanaddr, r, strupnperror(r));
|
||||
else
|
||||
if (r != UPNPCOMMAND_SUCCESS) {
|
||||
LogPrintf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n", port, port, lanaddr, r, strupnperror(r));
|
||||
} else {
|
||||
LogPrintf("UPnP Port Mapping successful.\n");
|
||||
}
|
||||
while(g_upnp_interrupt.sleep_for(std::chrono::minutes(20)));
|
||||
}
|
||||
} while (g_upnp_interrupt.sleep_for(std::chrono::minutes(20)));
|
||||
|
||||
r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), "TCP", 0);
|
||||
LogPrintf("UPNP_DeletePortMapping() returned: %d\n", r);
|
||||
|
|
Loading…
Reference in a new issue