summaryrefslogtreecommitdiff
path: root/Plexservice.h
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2014-11-18 20:41:44 +0100
committerchriszero <zerov83@gmail.com>2014-11-18 20:41:44 +0100
commit53143efc7a8b93ac779b494588e44c2ef47a1f12 (patch)
tree68307c1498c3bb25d9c24bedfebf78d5e42e2bec /Plexservice.h
parentfc243d8bfde7c24168b67f90341e7d0d114114b2 (diff)
downloadvdr-plugin-plex-53143efc7a8b93ac779b494588e44c2ef47a1f12.tar.gz
vdr-plugin-plex-53143efc7a8b93ac779b494588e44c2ef47a1f12.tar.bz2
Fixes seg fault on some systems
Diffstat (limited to 'Plexservice.h')
-rw-r--r--Plexservice.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/Plexservice.h b/Plexservice.h
index aad20a9..456341b 100644
--- a/Plexservice.h
+++ b/Plexservice.h
@@ -28,6 +28,9 @@
#include "user.h"
#include "MediaContainer.h"
+#include <Poco/ScopedLock.h>
+#include <Poco/Mutex.h>
+
namespace plexclient
{
@@ -48,12 +51,15 @@ public:
static MediaContainer* GetMediaContainer(std::string fullUrl);
-private:
+ private:
+ Poco::Mutex m_mutex;
+ // Never Access m_sToken directly! => possible race condition
+ std::string m_sToken;
+
std::string USERAGENT;
Poco::Net::HTTPClientSession *m_pPlexSession;
PlexServer *pServer;
- std::string m_sToken;
Poco::Net::HTTPClientSession* GetHttpSession(bool createNew = false);
Poco::Net::HTTPRequest* CreateRequest(std::string path);