From 9dc5a4fce39d85e36121be085eae2278e83b1864 Mon Sep 17 00:00:00 2001 From: hagen Date: Tue, 12 Jul 2016 00:00:00 +0000 Subject: [PATCH] * UPnP.{cpp,h} : cleanup & add class stub if opt-out --- UPnP.cpp | 13 ++++++++----- UPnP.h | 13 +++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/UPnP.cpp b/UPnP.cpp index 477342b3..3a6d0f5f 100644 --- a/UPnP.cpp +++ b/UPnP.cpp @@ -27,6 +27,7 @@ namespace transport void UPnP::Stop () { + LogPrint(eLogInfo, "UPnP: stopping"); if (m_Thread) { m_Thread->join (); @@ -37,6 +38,7 @@ namespace transport void UPnP::Start() { + LogPrint(eLogInfo, "UPnP: starting"); m_Thread = new std::thread (std::bind (&UPnP::Run, this)); } @@ -163,10 +165,11 @@ namespace transport m_Devlist = 0; FreeUPNPUrls (&m_upnpUrls); } - } } - - -#endif - +#else /* USE_UPNP */ +namespace i2p { +namespace transport { +} +} +#endif /* USE_UPNP */ diff --git a/UPnP.h b/UPnP.h index 0a000177..2831989a 100644 --- a/UPnP.h +++ b/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 // __UPNP_H__