mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-27 13:14:15 +00:00
debian wheezy upnp fix
This commit is contained in:
parent
ae28df5276
commit
94fc1a1cee
@ -82,8 +82,10 @@ namespace transport
|
|||||||
int nerror = 0;
|
int nerror = 0;
|
||||||
#if MINIUPNPC_API_VERSION >= 14
|
#if MINIUPNPC_API_VERSION >= 14
|
||||||
m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, 2, &nerror);
|
m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, 2, &nerror);
|
||||||
#else
|
#elseif MINIUPNPC_API_VERSION >= 8
|
||||||
m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, &nerror);
|
m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0, 0, &nerror);
|
||||||
|
#else
|
||||||
|
m_Devlist = upnpDiscover (2000, m_MulticastIf, m_Minissdpdpath, 0);
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
// notify satrting thread
|
// notify satrting thread
|
||||||
@ -155,7 +157,11 @@ namespace transport
|
|||||||
std::string strType (GetProto (address)), strPort (std::to_string (address->port));
|
std::string strType (GetProto (address)), strPort (std::to_string (address->port));
|
||||||
int r;
|
int r;
|
||||||
std::string strDesc; i2p::config::GetOption("upnp.name", strDesc);
|
std::string strDesc; i2p::config::GetOption("upnp.name", strDesc);
|
||||||
|
#if MINIUPNPC_API_VERSION >= 8
|
||||||
r = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), 0, "0");
|
r = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), 0, "0");
|
||||||
|
#else
|
||||||
|
r = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), 0);
|
||||||
|
#endif
|
||||||
if (r!=UPNPCOMMAND_SUCCESS)
|
if (r!=UPNPCOMMAND_SUCCESS)
|
||||||
{
|
{
|
||||||
LogPrint (eLogError, "UPnP: AddPortMapping (", m_NetworkAddr, ":", strPort, ") failed with code ", r);
|
LogPrint (eLogError, "UPnP: AddPortMapping (", m_NetworkAddr, ":", strPort, ") failed with code ", r);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user