diff options
-rw-r--r-- | include/webserver.h | 12 | ||||
-rw-r--r-- | server/webserver.cpp | 17 |
2 files changed, 16 insertions, 13 deletions
diff --git a/include/webserver.h b/include/webserver.h index 2509870..8b93a02 100644 --- a/include/webserver.h +++ b/include/webserver.h @@ -34,13 +34,13 @@ namespace upnp { bool Start(); void Stop(); - const std::string GetBaseUrl() const; - const std::string GetServiceUrl() const; - const std::string GetControlUrl() const; - const std::string GetStaticContentUrl() const; - const std::string GetPresentationUrl() const; + std::string GetBaseUrl() const; + std::string GetServiceUrl() const; + std::string GetControlUrl() const; + std::string GetStaticContentUrl() const; + std::string GetPresentationUrl() const; - const std::string GetThumbnailDir() const; + std::string GetThumbnailDir() const; std::string GetListenerAddress() const { return mListenerAddress; } uint16_t GetListenerPort() const { return mListenerPort; } diff --git a/server/webserver.cpp b/server/webserver.cpp index e76d519..c4f39d8 100644 --- a/server/webserver.cpp +++ b/server/webserver.cpp @@ -127,33 +127,36 @@ void cWebserver::SetPresentationUrl(std::string presentationUrl){ mPresentationUrl = presentationUrl; } -const std::string cWebserver::GetBaseUrl() const { +std::string cWebserver::GetBaseUrl() const { stringstream s; s << "http://" << mListenerAddress << ":" << mListenerPort << "/"; return s.str(); } -const std::string cWebserver::GetServiceUrl() const { +std::string cWebserver::GetServiceUrl() const { return GetBaseUrl() + mServiceUrl; } -const std::string cWebserver::GetControlUrl() const { +std::string cWebserver::GetControlUrl() const { stringstream s; s << "http://" << UpnpGetServerIpAddress() << ":" << UpnpGetServerPort() << "/services/"; return s.str(); } -const std::string cWebserver::GetPresentationUrl() const { +std::string cWebserver::GetPresentationUrl() const { return (mPresentationUrl.find("http://",0) == 0) ? mPresentationUrl : (GetBaseUrl() + mPresentationUrl); } -const std::string cWebserver::GetStaticContentUrl() const { +std::string cWebserver::GetStaticContentUrl() const { return GetBaseUrl() + mStaticContentUrl; } -const std::string cWebserver::GetThumbnailDir() const { - return mWebserverRootDir + "images/thumbs/"; +std::string cWebserver::GetThumbnailDir() const { + stringstream s; + s << mWebserverRootDir << "images/thumbs/"; + + return s.str(); } cWebserver::cWSThread::cWSThread(cWebserver& webServer) |