[vlc-commits] demux: adaptive: inherit/use playlist cookie jar (fix #9632)
Francois Cartegnie
git at videolan.org
Wed Oct 25 16:39:13 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Oct 25 16:23:33 2017 +0200| [c19e60abc5d09df40adf715e3862023bcd94d40a] | committer: Francois Cartegnie
demux: adaptive: inherit/use playlist cookie jar (fix #9632)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c19e60abc5d09df40adf715e3862023bcd94d40a
---
modules/demux/adaptive/adaptive.cpp | 2 +-
modules/demux/adaptive/http/AuthStorage.cpp | 9 ++++++---
modules/demux/adaptive/http/AuthStorage.hpp | 2 +-
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/modules/demux/adaptive/adaptive.cpp b/modules/demux/adaptive/adaptive.cpp
index 950aa758ec..78061ab7fe 100644
--- a/modules/demux/adaptive/adaptive.cpp
+++ b/modules/demux/adaptive/adaptive.cpp
@@ -152,7 +152,7 @@ static int Open(vlc_object_t *p_obj)
}
PlaylistManager *p_manager = NULL;
- AuthStorage *authStorage = new AuthStorage();
+ AuthStorage *authStorage = new AuthStorage(p_obj);
char *psz_logic = var_InheritString(p_obj, "adaptive-logic");
AbstractAdaptationLogic::LogicType logic = AbstractAdaptationLogic::Default;
diff --git a/modules/demux/adaptive/http/AuthStorage.cpp b/modules/demux/adaptive/http/AuthStorage.cpp
index d223304db6..303bcc96b5 100644
--- a/modules/demux/adaptive/http/AuthStorage.cpp
+++ b/modules/demux/adaptive/http/AuthStorage.cpp
@@ -26,14 +26,17 @@
using namespace adaptive::http;
-AuthStorage::AuthStorage()
+AuthStorage::AuthStorage( vlc_object_t *p_obj )
{
- p_cookies_jar = vlc_http_cookies_new();
+ if ( var_InheritBool( p_obj, "http-forward-cookies" ) )
+ p_cookies_jar = static_cast<vlc_http_cookie_jar_t *>
+ (var_InheritAddress( p_obj, "http-cookies" ));
+ else
+ p_cookies_jar = NULL;
}
AuthStorage::~AuthStorage()
{
- vlc_http_cookies_destroy( p_cookies_jar );
}
void AuthStorage::addCookie( const std::string &cookie, const ConnectionParams ¶ms )
diff --git a/modules/demux/adaptive/http/AuthStorage.hpp b/modules/demux/adaptive/http/AuthStorage.hpp
index ed62eddb79..528c6e8b49 100644
--- a/modules/demux/adaptive/http/AuthStorage.hpp
+++ b/modules/demux/adaptive/http/AuthStorage.hpp
@@ -34,7 +34,7 @@ namespace adaptive
class AuthStorage
{
public:
- AuthStorage();
+ AuthStorage(vlc_object_t *p_obj);
~AuthStorage();
void addCookie( const std::string &cookie, const ConnectionParams & );
std::string getCookie( const ConnectionParams &, bool secure );
More information about the vlc-commits
mailing list