From 48097745f6d7afcfed09713c2f8827588eb7b9f3 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 10 Jan 2014 22:42:02 +0100 Subject: db/upnp: remove "upnplog" option We have removed all libupnp logging calls, and we don't need to debug libupnp. --- src/db/UpnpDatabasePlugin.cxx | 7 +------ src/db/upnp/upnpplib.cxx | 31 +------------------------------ src/db/upnp/upnpplib.hxx | 8 -------- 3 files changed, 2 insertions(+), 44 deletions(-) (limited to 'src/db') diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx index a1b6519e0..ec86aa400 100644 --- a/src/db/UpnpDatabasePlugin.cxx +++ b/src/db/UpnpDatabasePlugin.cxx @@ -63,7 +63,6 @@ class UpnpDatabase : public Database { LibUPnP *m_lib; UPnPDeviceDirectory *m_superdir; Directory *m_root; - std::string m_upnplog; public: UpnpDatabase() @@ -194,9 +193,8 @@ UpnpDatabase::Create(const config_param ¶m, Error &error) } bool -UpnpDatabase::Configure(const config_param& param, Error&) +UpnpDatabase::Configure(const config_param &, Error &) { - m_upnplog = param.GetBlockValue("upnplog", ""); return true; } @@ -225,9 +223,6 @@ bool UpnpDatabase::reallyOpen(Error &error) if (!m_lib) return false; - if (!m_upnplog.empty()) { - m_lib->setLogFileName(m_upnplog); - } m_superdir = UPnPDeviceDirectory::getTheDir(); if (!m_superdir || !m_superdir->ok()) { error.Set(upnp_domain, "Discovery services startup failed"); diff --git a/src/db/upnp/upnpplib.cxx b/src/db/upnp/upnpplib.cxx index 2aa328e8d..c2db88d8f 100644 --- a/src/db/upnp/upnpplib.cxx +++ b/src/db/upnp/upnpplib.cxx @@ -20,16 +20,10 @@ #include "config.h" #include "upnpplib.hxx" #include "Domain.hxx" -#include "Util.hxx" #include "Log.hxx" -#include -#include -#include -#include - #include -#include +#include static LibUPnP *theLib; @@ -58,9 +52,6 @@ LibUPnP::LibUPnP() } setMaxContentLength(2000*1024); -#ifdef DEBUG - UpnpCloseLog(); -#endif code = UpnpRegisterClient(o_callback, (void *)this, &m_clh); if (code != UPNP_E_SUCCESS) { @@ -79,26 +70,6 @@ void LibUPnP::setMaxContentLength(int bytes) UpnpSetMaxContentLength(bytes); } -bool LibUPnP::setLogFileName(const std::string& fn) -{ - const ScopeLock protect(m_mutex); - - if (fn.empty()) { - UpnpCloseLog(); - } else { - UpnpSetLogLevel(UPNP_INFO); - UpnpSetLogFileNames(fn.c_str(), fn.c_str()); - int code = UpnpInitLog(); - if (code != UPNP_E_SUCCESS) { - FormatError(upnp_domain, "UpnpInitLog() failed: %s", - UpnpGetErrorMessage(code)); - return false; - } - } - - return true; -} - void LibUPnP::registerHandler(Upnp_EventType et, Upnp_FunPtr handler, void *cookie) { diff --git a/src/db/upnp/upnpplib.hxx b/src/db/upnp/upnpplib.hxx index efad193fb..b91441ec6 100644 --- a/src/db/upnp/upnpplib.hxx +++ b/src/db/upnp/upnpplib.hxx @@ -23,11 +23,9 @@ #include "thread/Mutex.hxx" #include "util/Error.hxx" -#include #include #include -#include /** Our link to libupnp. Initialize and keep the handle around */ class LibUPnP { @@ -58,12 +56,6 @@ public: /** Retrieve the singleton LibUPnP object */ static LibUPnP *getLibUPnP(Error &error); - /** Set log file name and activate logging. - * - * @param fn file name to use. Use empty string to turn logging off - */ - bool setLogFileName(const std::string& fn); - /** Set max library buffer size for reading content from servers. * The default is 200k and should be ok */ void setMaxContentLength(int bytes); -- cgit v1.2.3