[vlc-devel] [PATCH v2 2/2] access/http: Share cookies between all playlist items

Rémi Denis-Courmont remi at remlab.net
Sat Sep 13 14:34:00 CEST 2014


Le samedi 13 septembre 2014, 14:58:46 Antti Ajanki a écrit :
> @@ -1582,3 +1583,33 @@ static int AuthCheckReply( access_t *p_access, const
> char *psz_header, p_url->psz_username, p_url->psz_password ); }
> +
> +/**************************************************************************
> *** + * HTTP cookies
> +
> ***************************************************************************
> **/ +
> +/**
> + * Inherit a cookie jar reference from the playlist
> + *
> + * The returned pointer must be disposed of by calling
> + * http_cookies_release.
> + *
> + * @param p_this: http access object
> + * @return A new reference to a http_cookie_jar_t
> + */
> +static http_cookie_jar_t *GetCookieJarReference( vlc_object_t *p_this )
> +{
> +    http_cookie_jar_t *cookies = var_CreateGetAddress( p_this,
> "http-cookies" );

AFAICT, that should be var_InheritAddress(). I see no need to create a copy of 
the variable.

> +    if ( cookies )
> +        http_cookies_retain( cookies );
> +    return cookies;
> +}
> +
> +static void ReleaseCookieJar( vlc_object_t *p_this, access_sys_t *p_sys )
> +{
> +    var_Destroy( p_this, "http-cookies" );
> +    if ( p_sys->cookies ) {
> +        http_cookies_release( p_sys->cookies );
> +        p_sys->cookies = NULL;
> +    }
> +}
-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list