summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormethodus <methodus@web.de>2013-05-09 15:57:45 +0200
committermethodus <methodus@web.de>2013-05-09 15:57:45 +0200
commit11a035aa4ec2b55faaef1eaa48b7726a28422048 (patch)
tree7bfe8a1589d9ce56f47d76617c938c72323fd3e0
parenta224f8e589038ba17c6c80f1f07656642a4f057a (diff)
downloadvdr-plugin-upnp-master.tar.gz
vdr-plugin-upnp-master.tar.bz2
Fixed crash caused by recent changes in server and mediaManager.HEADmaster
-rw-r--r--media/mediaManager.cpp7
-rw-r--r--server/server.cpp13
2 files changed, 12 insertions, 8 deletions
diff --git a/media/mediaManager.cpp b/media/mediaManager.cpp
index 07afef2..96b7024 100644
--- a/media/mediaManager.cpp
+++ b/media/mediaManager.cpp
@@ -622,13 +622,6 @@ bool cMediaManager::Initialise(){
bool cMediaManager::CheckIntegrity(){
try {
- connection.execute("PRAGMA foreign_keys = ON");
- connection.execute("PRAGMA page_size = 4096");
- connection.execute("PRAGMA cache_size = 16384");
- connection.execute("PRAGMA temp_store = MEMORY");
- connection.execute("PRAGMA synchronous = NORMAL");
- connection.execute("PRAGMA locking_mode = EXCLUSIVE");
-
tntdb::Statement checkTable = connection.prepare(
"SELECT name FROM sqlite_master WHERE type='table' AND name=:table;"
);
diff --git a/server/server.cpp b/server/server.cpp
index 28895ac..4d208bd 100644
--- a/server/server.cpp
+++ b/server/server.cpp
@@ -215,7 +215,7 @@ bool cMediaServer::Initialize(){
isyslog("UPnP\tInitialized UPnP media server on %s:%d", UpnpGetServerIpAddress(), UpnpGetServerPort());
mWebserver = new cWebserver(GetServerIPAddress());
- mMediaManager = new cMediaManager();
+
stringstream ss;
if(mCurrentConfiguration.expertSettings){
@@ -252,11 +252,22 @@ bool cMediaServer::Initialize(){
ss << "sqlite:" << mCurrentConfiguration.databaseDir << "/metadata.db";
try {
mConnection = tntdb::connect(ss.str());
+
+ mConnection.execute("PRAGMA foreign_keys = ON");
+ mConnection.execute("PRAGMA page_size = 4096");
+ mConnection.execute("PRAGMA cache_size = 16384");
+ mConnection.execute("PRAGMA temp_store = MEMORY");
+ mConnection.execute("PRAGMA synchronous = NORMAL");
+ mConnection.execute("PRAGMA locking_mode = EXCLUSIVE");
+
+ isyslog("UPnP\tSuccessfully connected to %s.", ss.str().c_str());
} catch (const std::exception& e) {
esyslog("UPnP\tException occurred while connecting to database '%s': %s", ss.str().c_str(), e.what());
return false;
}
+ mMediaManager = new cMediaManager();
+
ret = UpnpSetMaxContentLength(GetMaxContentLength());
if(ret != UPNP_E_SUCCESS){