VLC 4.0.0-dev
vlc_http.h File Reference

This file defines functions, structures, enums and macros shared between HTTP clients. More...

Include dependency graph for vlc_http.h:

Go to the source code of this file.

Data Structures

struct  vlc_http_auth_t
 

Typedefs

typedef struct vlc_http_auth_t vlc_http_auth_t
 
typedef struct vlc_http_cookie_jar_t vlc_http_cookie_jar_t
 

Functions

void vlc_http_auth_Init (vlc_http_auth_t *)
 
void vlc_http_auth_Deinit (vlc_http_auth_t *)
 
void vlc_http_auth_ParseWwwAuthenticateHeader (vlc_object_t *, vlc_http_auth_t *, const char *)
 
int vlc_http_auth_ParseAuthenticationInfoHeader (vlc_object_t *, vlc_http_auth_t *, const char *, const char *, const char *, const char *, const char *)
 
char * vlc_http_auth_FormatAuthorizationHeader (vlc_object_t *, vlc_http_auth_t *, const char *, const char *, const char *, const char *)
 
vlc_http_cookie_jar_tvlc_http_cookies_new (void)
 
void vlc_http_cookies_destroy (vlc_http_cookie_jar_t *p_jar)
 
bool vlc_http_cookies_store (vlc_http_cookie_jar_t *jar, const char *cookie, const char *host, const char *path)
 Parse a value of an incoming Set-Cookie header and append the cookie to the cookie jar if appropriate. More...
 
char * vlc_http_cookies_fetch (vlc_http_cookie_jar_t *jar, bool secure, const char *host, const char *path)
 Returns a cookie value that match the given URL. More...
 

Detailed Description

This file defines functions, structures, enums and macros shared between HTTP clients.

Typedef Documentation

◆ vlc_http_auth_t

◆ vlc_http_cookie_jar_t

Function Documentation

◆ vlc_http_auth_Deinit()

◆ vlc_http_auth_FormatAuthorizationHeader()

char * vlc_http_auth_FormatAuthorizationHeader ( vlc_object_t p_this,
vlc_http_auth_t p_auth,
const char *  psz_method,
const char *  psz_path,
const char *  psz_username,
const char *  psz_password 
)

◆ vlc_http_auth_Init()

void vlc_http_auth_Init ( vlc_http_auth_t p_auth)

◆ vlc_http_auth_ParseAuthenticationInfoHeader()

int vlc_http_auth_ParseAuthenticationInfoHeader ( vlc_object_t p_this,
vlc_http_auth_t p_auth,
const char *  psz_header,
const char *  psz_method,
const char *  psz_path,
const char *  psz_username,
const char *  psz_password 
)

◆ vlc_http_auth_ParseWwwAuthenticateHeader()

◆ vlc_http_cookies_destroy()

◆ vlc_http_cookies_fetch()

char * vlc_http_cookies_fetch ( vlc_http_cookie_jar_t jar,
bool  secure,
const char *  host,
const char *  path 
)

Returns a cookie value that match the given URL.

Parameters
p_jara cookie jar
p_urlthe URL for which the cookies are returned
Returns
A string consisting of semicolon-separated cookie NAME=VALUE pairs.

References asprintf(), cookie_should_be_sent(), vlc_http_cookie_jar_t::cookies, vlc_http_cookie_jar_t::lock, http_cookie_t::psz_name, http_cookie_t::psz_value, vlc_array_count(), vlc_array_item_at_index, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by vlc_http_msg_add_cookies().

◆ vlc_http_cookies_new()

◆ vlc_http_cookies_store()

bool vlc_http_cookies_store ( vlc_http_cookie_jar_t jar,
const char *  cookie,
const char *  host,
const char *  path 
)

Parse a value of an incoming Set-Cookie header and append the cookie to the cookie jar if appropriate.

Parameters
jarcookie jar object
cookieheader field value of Set-Cookie
Returns
true, if the cookie was added, false otherwise

References cookie_destroy(), cookie_domain_matches(), cookie_parse(), vlc_http_cookie_jar_t::cookies, vlc_http_cookie_jar_t::lock, http_cookie_t::psz_domain, http_cookie_t::psz_name, http_cookie_t::psz_path, vlc_array_append(), vlc_array_count(), vlc_array_item_at_index, vlc_array_remove(), vlc_ascii_strcasecmp(), vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by vlc_http_msg_get_cookies().