mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 19:27:49 +02:00
[upnp] wtf? why its falling thru if statement?
This commit is contained in:
parent
2f516d03a5
commit
f62bd3d6dc
1 changed files with 7 additions and 7 deletions
|
@ -81,20 +81,20 @@ namespace transport
|
||||||
{
|
{
|
||||||
bool isError;
|
bool isError;
|
||||||
|
|
||||||
#if (MINIUPNPC_API_VERSION >= 8)
|
#if MINIUPNPC_API_VERSION >= 8
|
||||||
int err = UPNPDISCOVER_SUCCESS;
|
int err = UPNPDISCOVER_SUCCESS;
|
||||||
|
|
||||||
#if (MINIUPNPC_API_VERSION >= 14)
|
#if MINIUPNPC_API_VERSION >= 14
|
||||||
m_Devlist = upnpDiscover (UPNP_RESPONSE_TIMEOUT, NULL, NULL, 0, 0, 2, &err);
|
m_Devlist = upnpDiscover (UPNP_RESPONSE_TIMEOUT, NULL, NULL, 0, 0, 2, &err);
|
||||||
#else
|
#else
|
||||||
m_Devlist = upnpDiscover (UPNP_RESPONSE_TIMEOUT, NULL, NULL, 0, 0, &err);
|
m_Devlist = upnpDiscover (UPNP_RESPONSE_TIMEOUT, NULL, NULL, 0, 0, &err);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
isError = err != UPNPDISCOVER_SUCCESS;
|
isError = err != UPNPDISCOVER_SUCCESS;
|
||||||
#else
|
#else // MINIUPNPC_API_VERSION >= 8
|
||||||
m_Devlist = upnpDiscover (UPNP_RESPONSE_TIMEOUT, NULL, NULL, 0);
|
m_Devlist = upnpDiscover (UPNP_RESPONSE_TIMEOUT, NULL, NULL, 0);
|
||||||
isError = m_Devlist == NULL;
|
isError = m_Devlist == NULL;
|
||||||
#endif
|
#endif // MINIUPNPC_API_VERSION >= 8
|
||||||
{
|
{
|
||||||
// notify starting thread
|
// notify starting thread
|
||||||
std::unique_lock<std::mutex> l(m_StartedMutex);
|
std::unique_lock<std::mutex> l(m_StartedMutex);
|
||||||
|
@ -143,9 +143,9 @@ namespace transport
|
||||||
{
|
{
|
||||||
int err = UPNPCOMMAND_SUCCESS;
|
int err = UPNPCOMMAND_SUCCESS;
|
||||||
|
|
||||||
#if (MINIUPNPC_API_VERSION >= 10)
|
#if MINIUPNPC_API_VERSION >= 10
|
||||||
err = UPNP_GetSpecificPortMappingEntry(m_upnpUrls.controlURL, m_upnpData.first.servicetype, port, type, NULL, NULL, NULL, NULL, NULL, NULL);
|
err = UPNP_GetSpecificPortMappingEntry(m_upnpUrls.controlURL, m_upnpData.first.servicetype, port, type, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
#elif (MINIUPNPC_API_VERSION >= 8)
|
#elif MINIUPNPC_API_VERSION >= 8
|
||||||
err = UPNP_GetSpecificPortMappingEntry(m_upnpUrls.controlURL, m_upnpData.first.servicetype, port, type, NULL, NULL, NULL, NULL, NULL);
|
err = UPNP_GetSpecificPortMappingEntry(m_upnpUrls.controlURL, m_upnpData.first.servicetype, port, type, NULL, NULL, NULL, NULL, NULL);
|
||||||
#else
|
#else
|
||||||
err = UPNP_GetSpecificPortMappingEntry(m_upnpUrls.controlURL, m_upnpData.first.servicetype, port, type, NULL, NULL);
|
err = UPNP_GetSpecificPortMappingEntry(m_upnpUrls.controlURL, m_upnpData.first.servicetype, port, type, NULL, NULL);
|
||||||
|
@ -181,7 +181,7 @@ namespace transport
|
||||||
{
|
{
|
||||||
LogPrint (eLogDebug, "UPnP: port ", strPort, " possible is not forwarded: return code ", err);
|
LogPrint (eLogDebug, "UPnP: port ", strPort, " possible is not forwarded: return code ", err);
|
||||||
|
|
||||||
#if (MINIUPNPC_API_VERSION >= 8)
|
#if MINIUPNPC_API_VERSION >= 8
|
||||||
err = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), NULL, NULL);
|
err = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), NULL, NULL);
|
||||||
#else
|
#else
|
||||||
err = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), NULL);
|
err = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue