summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormethodus <methodus@web.de>2012-12-01 19:06:52 +0100
committermethodus <methodus@web.de>2012-12-01 19:06:52 +0100
commit5338b6f476b2ec1f12327907c2522ff07999a9c3 (patch)
treebd70708167446400b2780a5202f5dee35e22f96e
parent0bc51c7bb1b2779193f06b4cdfb3db4ba2a0c39b (diff)
downloadvdr-plugin-upnp-5338b6f476b2ec1f12327907c2522ff07999a9c3.tar.gz
vdr-plugin-upnp-5338b6f476b2ec1f12327907c2522ff07999a9c3.tar.bz2
Fixed static access of setKeepAliveTimeout
-rw-r--r--httptnt/resourceStreamer.ecpp2
-rw-r--r--include/webserver.h1
-rw-r--r--server/webserver.cpp8
3 files changed, 9 insertions, 2 deletions
diff --git a/httptnt/resourceStreamer.ecpp b/httptnt/resourceStreamer.ecpp
index d978b04..e143f93 100644
--- a/httptnt/resourceStreamer.ecpp
+++ b/httptnt/resourceStreamer.ecpp
@@ -38,8 +38,6 @@ using namespace upnp;
int code = HTTP_OK;
string codeText = "OK";
- // DLNA requires KeepAlive timeout of 60s.
- tnt::HttpReply::setKeepAliveTimeout(60000);
reply.setContentType(streamer->GetContentType());
reply.setHeader("friendlyName.dlna.org ", server->GetServerDescription().friendlyName);
reply.setHeader("contentFeatures.dlna.org ", streamer->GetContentFeatures());
diff --git a/include/webserver.h b/include/webserver.h
index 5e03fbb..1147b04 100644
--- a/include/webserver.h
+++ b/include/webserver.h
@@ -22,6 +22,7 @@ namespace upnp {
cWebserver(std::string address);
virtual ~cWebserver();
+ void SetKeepAliveTimeout(unsigned int seconds);
void SetMaxRequestTime(unsigned int seconds);
void SetWebserverRootDir(std::string rootDirectory);
void SetPresentationUrl(std::string presentationUrl);
diff --git a/server/webserver.cpp b/server/webserver.cpp
index b293d9b..c2dfad2 100644
--- a/server/webserver.cpp
+++ b/server/webserver.cpp
@@ -80,6 +80,9 @@ bool cWebserver::Initialise(){
isyslog("UPnP\tUsing %s for static content delivery.", mWebserverRootDir.c_str());
+ // DLNA requires KeepAlive timeout of 60s.
+ SetKeepAliveTimeout(60000);
+
} catch (const std::exception& e){
esyslog("UPnP\tError while initialising web server: %s", e.what());
return false;
@@ -99,6 +102,11 @@ void cWebserver::SetMaxRequestTime(unsigned int seconds){
config.setMaxRequestTime(seconds);
}
+void cWebserver::SetKeepAliveTimeout(unsigned int milliseconds){
+ tnt::Configurator config(mApplication);
+ config.setKeepAliveTimeout(milliseconds);
+}
+
void cWebserver::SetWebserverRootDir(std::string rootDirectory){
if(mWebserverThread.Active()) return;