VLC  3.0.21
Data Structures | Macros | Enumerations | Functions | Variables
httpd.c File Reference
Include dependency graph for httpd.c:

Data Structures

struct  httpd_host_t
 
struct  httpd_url_t
 
struct  httpd_client_t
 
struct  httpd_file_t
 
struct  httpd_handler_t
 
struct  httpd_redirect_t
 
struct  httpd_stream_t
 
struct  httpd
 

Macros

#define HTTPD_CL_BUFSIZE   10000
 

Enumerations

enum  {
  HTTPD_CLIENT_RECEIVING, HTTPD_CLIENT_RECEIVE_DONE, HTTPD_CLIENT_SENDING, HTTPD_CLIENT_SEND_DONE,
  HTTPD_CLIENT_WAITING, HTTPD_CLIENT_DEAD, HTTPD_CLIENT_TLS_HS_IN, HTTPD_CLIENT_TLS_HS_OUT
}
 

Functions

static void httpd_ClientDestroy (httpd_client_t *cl)
 
static void httpd_AppendData (httpd_stream_t *stream, uint8_t *p_data, int i_data)
 
static const char * httpd_ReasonFromCode (unsigned i_code)
 
static size_t httpd_HtmlError (char **body, int code, const char *url)
 
static int httpd_FileCallBack (httpd_callback_sys_t *p_sys, httpd_client_t *cl, httpd_message_t *answer, const httpd_message_t *query)
 
httpd_file_thttpd_FileNew (httpd_host_t *host, const char *psz_url, const char *psz_mime, const char *psz_user, const char *psz_password, httpd_file_callback_t pf_fill, httpd_file_sys_t *p_sys)
 
httpd_file_sys_thttpd_FileDelete (httpd_file_t *file)
 
static int httpd_HandlerCallBack (httpd_callback_sys_t *p_sys, httpd_client_t *cl, httpd_message_t *answer, const httpd_message_t *query)
 
httpd_handler_thttpd_HandlerNew (httpd_host_t *host, const char *psz_url, const char *psz_user, const char *psz_password, httpd_handler_callback_t pf_fill, void *p_sys)
 
void * httpd_HandlerDelete (httpd_handler_t *handler)
 
static int httpd_RedirectCallBack (httpd_callback_sys_t *p_sys, httpd_client_t *cl, httpd_message_t *answer, const httpd_message_t *query)
 
httpd_redirect_thttpd_RedirectNew (httpd_host_t *host, const char *psz_url_dst, const char *psz_url_src)
 
void httpd_RedirectDelete (httpd_redirect_t *rdir)
 
static int httpd_StreamCallBack (httpd_callback_sys_t *p_sys, httpd_client_t *cl, httpd_message_t *answer, const httpd_message_t *query)
 
httpd_stream_thttpd_StreamNew (httpd_host_t *host, const char *psz_url, const char *psz_mime, const char *psz_user, const char *psz_password)
 
int httpd_StreamHeader (httpd_stream_t *stream, uint8_t *p_data, int i_data)
 
int httpd_StreamSend (httpd_stream_t *stream, const block_t *p_block)
 
void httpd_StreamDelete (httpd_stream_t *stream)
 
static void * httpd_HostThread (void *)
 
static httpd_host_thttpd_HostCreate (vlc_object_t *, const char *, const char *, vlc_tls_creds_t *, unsigned)
 
httpd_host_tvlc_http_HostNew (vlc_object_t *p_this)
 
httpd_host_tvlc_https_HostNew (vlc_object_t *obj)
 
httpd_host_tvlc_rtsp_HostNew (vlc_object_t *p_this)
 
void httpd_HostDelete (httpd_host_t *host)
 
httpd_url_thttpd_UrlNew (httpd_host_t *host, const char *psz_url, const char *psz_user, const char *psz_password)
 
int httpd_UrlCatch (httpd_url_t *url, int i_msg, httpd_callback_t cb, httpd_callback_sys_t *p_sys)
 
void httpd_UrlDelete (httpd_url_t *url)
 
static void httpd_MsgInit (httpd_message_t *msg)
 
static void httpd_MsgClean (httpd_message_t *msg)
 
const char * httpd_MsgGet (const httpd_message_t *msg, const char *name)
 
void httpd_MsgAdd (httpd_message_t *msg, const char *name, const char *psz_value,...)
 
static void httpd_ClientInit (httpd_client_t *cl)
 
char * httpd_ClientIP (const httpd_client_t *cl, char *ip, int *port)
 
char * httpd_ServerIP (const httpd_client_t *cl, char *ip, int *port)
 
static httpd_client_thttpd_ClientNew (vlc_tls_t *sock)
 
static ssize_t httpd_NetRecv (httpd_client_t *cl, uint8_t *p, size_t i_len)
 
static ssize_t httpd_NetSend (httpd_client_t *cl, const uint8_t *p, size_t i_len)
 
static int httpd_ClientRecv (httpd_client_t *cl)
 
static int httpd_ClientSend (httpd_client_t *cl)
 
static void httpd_ClientTlsHandshake (httpd_host_t *host, httpd_client_t *cl)
 
static bool httpdAuthOk (const char *user, const char *pass, const char *b64)
 
static void httpdLoop (httpd_host_t *host)
 
int httpd_StreamSetHTTPHeaders (httpd_stream_t *p_stream, const httpd_header *p_headers, size_t i_headers)
 

Variables

static struct httpd httpd = { PTHREAD_MUTEX_INITIALIZER , NULL, 0 }
 
struct {
   const char   name [16]
 
   int   i_type
 
   int   i_proto
 
msg_type []
 

Macro Definition Documentation

◆ HTTPD_CL_BUFSIZE

#define HTTPD_CL_BUFSIZE   10000

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
HTTPD_CLIENT_RECEIVING 
HTTPD_CLIENT_RECEIVE_DONE 
HTTPD_CLIENT_SENDING 
HTTPD_CLIENT_SEND_DONE 
HTTPD_CLIENT_WAITING 
HTTPD_CLIENT_DEAD 
HTTPD_CLIENT_TLS_HS_IN 
HTTPD_CLIENT_TLS_HS_OUT 

Function Documentation

◆ httpd_AppendData()

static void httpd_AppendData ( httpd_stream_t stream,
uint8_t *  p_data,
int  i_data 
)
static

◆ httpd_ClientDestroy()

static void httpd_ClientDestroy ( httpd_client_t cl)
static

◆ httpd_ClientInit()

static void httpd_ClientInit ( httpd_client_t cl)
static

◆ httpd_ClientIP()

char* httpd_ClientIP ( const httpd_client_t cl,
char *  ip,
int *  port 
)

◆ httpd_ClientNew()

static httpd_client_t* httpd_ClientNew ( vlc_tls_t sock)
static

◆ httpd_ClientRecv()

static int httpd_ClientRecv ( httpd_client_t cl)
static

References HTTPD_MSG_HEAD, and HTTPD_PROTO_HTTP.

◆ httpd_ClientSend()

static int httpd_ClientSend ( httpd_client_t cl)
static

◆ httpd_ClientTlsHandshake()

static void httpd_ClientTlsHandshake ( httpd_host_t host,
httpd_client_t cl 
)
static

◆ httpd_FileCallBack()

static int httpd_FileCallBack ( httpd_callback_sys_t p_sys,
httpd_client_t cl,
httpd_message_t answer,
const httpd_message_t query 
)
static

◆ httpd_FileDelete()

httpd_file_sys_t* httpd_FileDelete ( httpd_file_t file)

◆ httpd_FileNew()

httpd_file_t* httpd_FileNew ( httpd_host_t host,
const char *  psz_url,
const char *  psz_mime,
const char *  psz_user,
const char *  psz_password,
httpd_file_callback_t  pf_fill,
httpd_file_sys_t p_sys 
)

◆ httpd_HandlerCallBack()

static int httpd_HandlerCallBack ( httpd_callback_sys_t p_sys,
httpd_client_t cl,
httpd_message_t answer,
const httpd_message_t query 
)
static

< No error

< No error

◆ httpd_HandlerDelete()

void* httpd_HandlerDelete ( httpd_handler_t handler)

◆ httpd_HandlerNew()

httpd_handler_t* httpd_HandlerNew ( httpd_host_t host,
const char *  psz_url,
const char *  psz_user,
const char *  psz_password,
httpd_handler_callback_t  pf_fill,
void *  p_sys 
)

◆ httpd_HostCreate()

static httpd_host_t * httpd_HostCreate ( vlc_object_t p_this,
const char *  hostvar,
const char *  portvar,
vlc_tls_creds_t p_tls,
unsigned  timeout_sec 
)
static

Referenced by vlc_https_HostNew().

◆ httpd_HostDelete()

void httpd_HostDelete ( httpd_host_t host)

◆ httpd_HostThread()

static void * httpd_HostThread ( void *  data)
static

◆ httpd_HtmlError()

static size_t httpd_HtmlError ( char **  body,
int  code,
const char *  url 
)
static

◆ httpd_MsgAdd()

void httpd_MsgAdd ( httpd_message_t msg,
const char *  name,
const char *  psz_value,
  ... 
)

Referenced by httpd_FileCallBack().

◆ httpd_MsgClean()

static void httpd_MsgClean ( httpd_message_t msg)
static

◆ httpd_MsgGet()

const char* httpd_MsgGet ( const httpd_message_t msg,
const char *  name 
)

Referenced by httpd_FileCallBack().

◆ httpd_MsgInit()

static void httpd_MsgInit ( httpd_message_t msg)
static

◆ httpd_NetRecv()

static ssize_t httpd_NetRecv ( httpd_client_t cl,
uint8_t *  p,
size_t  i_len 
)
static

◆ httpd_NetSend()

static ssize_t httpd_NetSend ( httpd_client_t cl,
const uint8_t *  p,
size_t  i_len 
)
static

References p.

◆ httpd_ReasonFromCode()

static const char* httpd_ReasonFromCode ( unsigned  i_code)
static

References p.

Referenced by httpd_HtmlError().

◆ httpd_RedirectCallBack()

static int httpd_RedirectCallBack ( httpd_callback_sys_t p_sys,
httpd_client_t cl,
httpd_message_t answer,
const httpd_message_t query 
)
static

< No error

< No error

◆ httpd_RedirectDelete()

void httpd_RedirectDelete ( httpd_redirect_t rdir)

◆ httpd_RedirectNew()

httpd_redirect_t* httpd_RedirectNew ( httpd_host_t host,
const char *  psz_url_dst,
const char *  psz_url_src 
)

◆ httpd_ServerIP()

char* httpd_ServerIP ( const httpd_client_t cl,
char *  ip,
int *  port 
)

◆ httpd_StreamCallBack()

static int httpd_StreamCallBack ( httpd_callback_sys_t p_sys,
httpd_client_t cl,
httpd_message_t answer,
const httpd_message_t query 
)
static

< No error

< Unspecified error

< Unspecified error

< Unspecified error

< No error

< No error

◆ httpd_StreamDelete()

void httpd_StreamDelete ( httpd_stream_t stream)

◆ httpd_StreamHeader()

int httpd_StreamHeader ( httpd_stream_t stream,
uint8_t *  p_data,
int  i_data 
)

< No error

◆ httpd_StreamNew()

httpd_stream_t* httpd_StreamNew ( httpd_host_t host,
const char *  psz_url,
const char *  psz_mime,
const char *  psz_user,
const char *  psz_password 
)

◆ httpd_StreamSend()

int httpd_StreamSend ( httpd_stream_t stream,
const block_t p_block 
)

< No error

< No error

◆ httpd_StreamSetHTTPHeaders()

int httpd_StreamSetHTTPHeaders ( httpd_stream_t p_stream,
const httpd_header p_headers,
size_t  i_headers 
)

< Unspecified error

< No error

< Not enough memory

< No error

◆ httpd_UrlCatch()

int httpd_UrlCatch ( httpd_url_t url,
int  i_msg,
httpd_callback_t  cb,
httpd_callback_sys_t p_sys 
)

< No error

◆ httpd_UrlDelete()

void httpd_UrlDelete ( httpd_url_t url)

◆ httpd_UrlNew()

httpd_url_t* httpd_UrlNew ( httpd_host_t host,
const char *  psz_url,
const char *  psz_user,
const char *  psz_password 
)

◆ httpdAuthOk()

static bool httpdAuthOk ( const char *  user,
const char *  pass,
const char *  b64 
)
static

◆ httpdLoop()

static void httpdLoop ( httpd_host_t host)
static

◆ vlc_http_HostNew()

httpd_host_t* vlc_http_HostNew ( vlc_object_t p_this)

◆ vlc_https_HostNew()

httpd_host_t* vlc_https_HostNew ( vlc_object_t obj)

References httpd_HostCreate().

◆ vlc_rtsp_HostNew()

httpd_host_t* vlc_rtsp_HostNew ( vlc_object_t p_this)

Variable Documentation

◆ httpd

struct httpd httpd = { PTHREAD_MUTEX_INITIALIZER , NULL, 0 }
static

◆ i_proto

int i_proto

◆ i_type

int i_type

◆ msg_type

const { ... } msg_type[]

◆ name

const char name[16]

Referenced by aout_FiltersNew(), aout_HotplugNotify(), aout_HotplugReport(), AppendFilter(), AppendRemapFilter(), config_ChainParse(), config_GetIntChoices(), config_GetPszChoices(), config_LoadCmdLine(), CreateFilter(), filter_AddProxyCallbacks(), filter_chain_AppendFilter(), filter_chain_AppendFromString(), filter_chain_AppendInner(), filter_DelProxyCallbacks(), getaddrinfo(), getAppDependentDir(), getenv(), hpack_append_hdr(), hpack_decode(), hpack_decode_hdr_index(), hpack_decode_hdr_indexed(), hpack_decode_hdr_noindex(), hpack_decode_tbl_update(), hpack_encode_hdr_neverindex(), info_category_AddInfo(), info_category_DeleteInfo(), info_category_FindInfo(), info_category_New(), info_category_VaAddInfo(), info_New(), input_ExtractAttachmentAndCacheArt(), input_item_AddOpaque(), libvlc_InternalActionsInit(), libvlc_InternalAddIntf(), makeipv4info(), module_find(), module_list_cap(), module_match_name(), module_need(), playlist_EnableAudioFilter(), playlist_ServicesDiscoveryRemove(), process_list(), sdp_AddAttribute(), SelectClockSource(), sout_AccessOutNew(), stream_FilterChainNew(), stream_HasExtension(), system_ConfigureDbus(), var_Copy(), var_CopyDevice(), vlc_actions_get_id(), vlc_demux_chained_New(), vlc_getaddrinfo_i11e(), vlc_gl_GetProcAddress(), vlc_http_msg_add_header(), vlc_http_msg_get_header(), vlc_http_msg_get_time(), vlc_http_msg_h2_headers(), vlc_http_msg_headers(), vlc_http_msg_vadd_header(), vlc_https_connect(), vlc_keycode2str(), vlc_module_load(), vlc_module_store(), vlc_object_get_name(), vlc_object_set_name(), vlc_plugin_desc_cb(), vlc_plugin_get_symbol(), vlc_plugin_gpa_cb(), vlc_sd_probe_Add(), vlc_str2keycode(), vlc_tls_SocketOpenTCP(), vlc_tls_SocketOpenTLS(), vout_snapshot_SaveImage(), and vsdp_AddAttribute().

HTTPD_PROTO_RTSP
Definition: vlc_httpd.h:61
HTTPD_MSG_PLAY
Definition: vlc_httpd.h:48
HTTPD_MSG_GET
Definition: vlc_httpd.h:40
HTTPD_PROTO_NONE
Definition: vlc_httpd.h:59
HTTPD_MSG_POST
Definition: vlc_httpd.h:42
HTTPD_MSG_DESCRIBE
Definition: vlc_httpd.h:46
HTTPD_MSG_TEARDOWN
Definition: vlc_httpd.h:51
HTTPD_MSG_HEAD
Definition: vlc_httpd.h:41
HTTPD_MSG_PAUSE
Definition: vlc_httpd.h:49
HTTPD_PROTO_HTTP
Definition: vlc_httpd.h:60
HTTPD_MSG_SETUP
Definition: vlc_httpd.h:47
HTTPD_MSG_OPTIONS
Definition: vlc_httpd.h:45
HTTPD_MSG_GETPARAMETER
Definition: vlc_httpd.h:50
HTTPD_MSG_NONE
Definition: vlc_httpd.h:34