httpd.c File Reference

Include dependency graph for httpd.c:


Data Structures

struct  httpd_t
struct  httpd_host_t
struct  httpd_url_t
struct  httpd_client_t
struct  http_status_info
struct  httpd_file_t
struct  httpd_handler_t
struct  httpd_redirect_t
struct  httpd_stream_t

Defines

#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
}
enum  { HTTPD_CLIENT_FILE, HTTPD_CLIENT_STREAM, HTTPD_CLIENT_BIDIR }

Functions

static void httpd_ClientClean (httpd_client_t *cl)
static const char * httpd_MimeFromUrl (const char *psz_url)
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, const vlc_acl_t *p_acl, 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, const vlc_acl_t *p_acl, httpd_handler_callback_t pf_fill, httpd_handler_sys_t *p_sys)
httpd_handler_sys_thttpd_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, const vlc_acl_t *p_acl)
int httpd_StreamHeader (httpd_stream_t *stream, uint8_t *p_data, int i_data)
int httpd_StreamSend (httpd_stream_t *stream, uint8_t *p_data, int i_data)
void httpd_StreamDelete (httpd_stream_t *stream)
static void * httpd_HostThread (void *)
httpd_host_thttpd_HostNew (vlc_object_t *p_this, const char *psz_host, int i_port)
httpd_host_thttpd_TLSHostNew (vlc_object_t *p_this, const char *psz_hostname, int i_port, const char *psz_cert, const char *psz_key, const char *psz_ca, const char *psz_crl)
void httpd_HostDelete (httpd_host_t *host)
static httpd_url_thttpd_UrlNewPrivate (httpd_host_t *host, const char *psz_url, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl, bool b_check)
httpd_url_thttpd_UrlNew (httpd_host_t *host, const char *psz_url, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl)
httpd_url_thttpd_UrlNewUnique (httpd_host_t *host, const char *psz_url, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl)
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, mtime_t now)
void httpd_ClientModeStream (httpd_client_t *cl)
void httpd_ClientModeBidir (httpd_client_t *cl)
char * httpd_ClientIP (const httpd_client_t *cl, char *psz_ip)
char * httpd_ServerIP (const httpd_client_t *cl, char *psz_ip)
static httpd_client_thttpd_ClientNew (int fd, tls_session_t *p_tls, mtime_t now)
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 void httpd_ClientRecv (httpd_client_t *cl)
static void httpd_ClientSend (httpd_client_t *cl)
static void httpd_ClientTlsHsIn (httpd_client_t *cl)
static void httpd_ClientTlsHsOut (httpd_client_t *cl)

Variables

struct {
   const char   psz_ext [8]
   const char *   psz_mime
http_mime []
static const http_status_info http_reason []
static const char psz_fallback_reason [5][16]
static const char psz_object_type [] = "http server"
static vlc_mutex_t httpd_mutex = PTHREAD_MUTEX_INITIALIZER
struct {
   const char   name [16]
   int   i_type
   int   i_proto
msg_type []

Define Documentation

#define HTTPD_CL_BUFSIZE   10000


Enumeration Type Documentation

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 

anonymous enum

Enumerator:
HTTPD_CLIENT_FILE 
HTTPD_CLIENT_STREAM 
HTTPD_CLIENT_BIDIR 


Function Documentation

static void httpd_ClientClean ( httpd_client_t cl  )  [static]

static void httpd_ClientInit ( httpd_client_t cl,
mtime_t  now 
) [static]

char* httpd_ClientIP ( const httpd_client_t cl,
char *  psz_ip 
)

void httpd_ClientModeBidir ( httpd_client_t cl  ) 

void httpd_ClientModeStream ( httpd_client_t cl  ) 

static httpd_client_t* httpd_ClientNew ( int  fd,
tls_session_t p_tls,
mtime_t  now 
) [static]

static void httpd_ClientRecv ( httpd_client_t cl  )  [static]

static void httpd_ClientSend ( httpd_client_t cl  )  [static]

static void httpd_ClientTlsHsIn ( httpd_client_t cl  )  [static]

static void httpd_ClientTlsHsOut ( httpd_client_t cl  )  [static]

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

References VLC_SUCCESS.

Referenced by httpd_FileNew().

httpd_file_sys_t* httpd_FileDelete ( httpd_file_t file  ) 

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,
const vlc_acl_t p_acl,
httpd_file_callback_t  pf_fill,
httpd_file_sys_t p_sys 
)

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

References VLC_SUCCESS.

Referenced by httpd_HandlerNew().

httpd_handler_sys_t* httpd_HandlerDelete ( httpd_handler_t handler  ) 

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

void httpd_HostDelete ( httpd_host_t host  ) 

httpd_host_t* httpd_HostNew ( vlc_object_t p_this,
const char *  psz_host,
int  i_port 
)

References httpd_TLSHostNew().

static void * httpd_HostThread ( void *  data  )  [static]

Referenced by httpd_TLSHostNew().

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

static const char* httpd_MimeFromUrl ( const char *  psz_url  )  [static]

References i.

Referenced by httpd_FileNew(), and httpd_StreamNew().

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

static void httpd_MsgClean ( httpd_message_t msg  )  [static]

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

static void httpd_MsgInit ( httpd_message_t msg  )  [static]

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

Referenced by httpd_ClientRecv().

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

static const char* httpd_ReasonFromCode ( unsigned  i_code  )  [static]

Referenced by httpd_ClientSend().

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

References VLC_SUCCESS.

void httpd_RedirectDelete ( httpd_redirect_t rdir  ) 

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

char* httpd_ServerIP ( const httpd_client_t cl,
char *  psz_ip 
)

References httpd_client_t::fd.

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

References VLC_SUCCESS.

Referenced by httpd_StreamNew().

void httpd_StreamDelete ( httpd_stream_t stream  ) 

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

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,
const vlc_acl_t p_acl 
)

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

References VLC_SUCCESS.

httpd_host_t* httpd_TLSHostNew ( vlc_object_t p_this,
const char *  psz_hostname,
int  i_port,
const char *  psz_cert,
const char *  psz_key,
const char *  psz_ca,
const char *  psz_crl 
)

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  ) 

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

static httpd_url_t* httpd_UrlNewPrivate ( httpd_host_t host,
const char *  psz_url,
const char *  psz_user,
const char *  psz_password,
const vlc_acl_t p_acl,
bool  b_check 
) [static]

httpd_url_t* httpd_UrlNewUnique ( httpd_host_t host,
const char *  psz_url,
const char *  psz_user,
const char *  psz_password,
const vlc_acl_t p_acl 
)


Variable Documentation

struct { ... } http_mime[] [static]

const http_status_info http_reason[] [static]

Initial value:

{
  
    { 200, "OK" },
  
    { 301, "Moved permanently" },
  
    { 401, "Unauthorized" },
  
    { 403, "Forbidden" },
    { 404, "Not found" },
    { 405, "Method not allowed" },
  
    { 454, "Session not found" },
  
    { 456, "Header field not valid for resource" },
  
    { 459, "Aggregate operation not allowed" },
    { 460, "Non-aggregate operation not allowed" },
    { 461, "Unsupported transport" },
  
    { 500, "Internal server error" },
    { 501, "Not implemented" },
  
    { 503, "Service unavailable" },
  
    { 505, "Protocol version not supported" },
    { 551, "Option not supported" },
    { 999, "" }
}

vlc_mutex_t httpd_mutex = PTHREAD_MUTEX_INITIALIZER [static]

int i_proto

Referenced by MMSTUOpen().

int i_type

struct { ... } msg_type[] [static]

const char name[16]

const char psz_ext[8]

const char psz_fallback_reason[5][16] [static]

Initial value:

{ "Continue", "OK", "Found", "Client error", "Server error" }

const char* psz_mime

const char psz_object_type[] = "http server" [static]


Generated on Sat Nov 21 08:05:57 2009 for VLC by  doxygen 1.5.6