mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
* UPnP.{cpp,h} : cleanup & add class stub if opt-out
This commit is contained in:
parent
fda3cd5fe7
commit
9dc5a4fce3
13
UPnP.cpp
13
UPnP.cpp
|
@ -27,6 +27,7 @@ namespace transport
|
||||||
|
|
||||||
void UPnP::Stop ()
|
void UPnP::Stop ()
|
||||||
{
|
{
|
||||||
|
LogPrint(eLogInfo, "UPnP: stopping");
|
||||||
if (m_Thread)
|
if (m_Thread)
|
||||||
{
|
{
|
||||||
m_Thread->join ();
|
m_Thread->join ();
|
||||||
|
@ -37,6 +38,7 @@ namespace transport
|
||||||
|
|
||||||
void UPnP::Start()
|
void UPnP::Start()
|
||||||
{
|
{
|
||||||
|
LogPrint(eLogInfo, "UPnP: starting");
|
||||||
m_Thread = new std::thread (std::bind (&UPnP::Run, this));
|
m_Thread = new std::thread (std::bind (&UPnP::Run, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,10 +165,11 @@ namespace transport
|
||||||
m_Devlist = 0;
|
m_Devlist = 0;
|
||||||
FreeUPNPUrls (&m_upnpUrls);
|
FreeUPNPUrls (&m_upnpUrls);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else /* USE_UPNP */
|
||||||
|
namespace i2p {
|
||||||
#endif
|
namespace transport {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* USE_UPNP */
|
||||||
|
|
13
UPnP.h
13
UPnP.h
|
@ -52,5 +52,18 @@ namespace transport
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else // USE_UPNP
|
||||||
|
namespace i2p {
|
||||||
|
namespace transport {
|
||||||
|
/* class stub */
|
||||||
|
class UPnP {
|
||||||
|
public:
|
||||||
|
UPnP () {};
|
||||||
|
~UPnP () {};
|
||||||
|
void Start () { LogPrint(eLogWarning, "UPnP: this module was disabled at compile-time"); }
|
||||||
|
void Stop () {};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif // USE_UPNP
|
#endif // USE_UPNP
|
||||||
#endif // __UPNP_H__
|
#endif // __UPNP_H__
|
||||||
|
|
Loading…
Reference in a new issue