/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
#include <vlc_access.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
-#include <fcntl.h>
#include <sys/types.h>
-#include <errno.h>
-
/* Include dvbpsi headers */
#ifdef HAVE_DVBPSI_DR_H
# include <dvbpsi/dvbpsi.h>
# include <dvbpsi/pmt.h>
# include <dvbpsi/dr.h>
# include <dvbpsi/psi.h>
+# include <dvbpsi/demux.h>
+# include <dvbpsi/sdt.h>
#else
# include "dvbpsi.h"
# include "descriptor.h"
# include "tables/pmt.h"
# include "descriptors/dr.h"
# include "psi.h"
+# include "demux.h"
+# include "tables/sdt.h"
#endif
#ifdef ENABLE_HTTPD
-# include "vlc_httpd.h"
-# include "vlc_acl.h"
+# include <vlc_httpd.h>
+# include <vlc_acl.h>
#endif
#include "dvb.h"
/*****************************************************************************
* HTTPOpen: Start the internal HTTP server
*****************************************************************************/
-int E_(HTTPOpen)( access_t *p_access )
+int HTTPOpen( access_t *p_access )
{
access_sys_t *p_sys = p_access->p_sys;
char *psz_address, *psz_cert = NULL, *psz_key = NULL,
vlc_acl_t *p_acl = NULL;
httpd_file_sys_t *f;
- vlc_mutex_init( p_access, &p_sys->httpd_mutex );
- vlc_cond_init( p_access, &p_sys->httpd_cond );
- p_sys->b_request_frontend_info = p_sys->b_request_mmi_info = VLC_FALSE;
+ vlc_mutex_init( &p_sys->httpd_mutex );
+ vlc_cond_init( &p_sys->httpd_cond );
+ p_sys->b_request_frontend_info = p_sys->b_request_mmi_info = false;
p_sys->i_httpd_timeout = 0;
psz_address = var_GetNonEmptyString( p_access, "dvb-http-host" );
return VLC_SUCCESS;
/* determine SSL configuration */
- psz_cert = var_GetNonEmptyString( p_access, "dvb-http-intf-cert" );
+ psz_cert = var_InheritString( p_access, "dvb-http-intf-cert" );
if ( psz_cert != NULL )
{
msg_Dbg( p_access, "enabling TLS for HTTP interface (cert file: %s)",
psz_cert );
- psz_key = config_GetPsz( p_access, "dvb-http-intf-key" );
- psz_ca = config_GetPsz( p_access, "dvb-http-intf-ca" );
- psz_crl = config_GetPsz( p_access, "dvb-http-intf-crl" );
+ psz_key = var_InheritString( p_access, "dvb-http-intf-key" );
+ psz_ca = var_InheritString( p_access, "dvb-http-intf-ca" );
+ psz_crl = var_InheritString( p_access, "dvb-http-intf-crl" );
if ( i_port <= 0 )
i_port = 8443;
if ( psz_acl != NULL )
{
- p_acl = ACL_Create( p_access, VLC_FALSE );
+ p_acl = ACL_Create( p_access, false );
if( ACL_LoadFile( p_acl, psz_acl ) )
{
ACL_Destroy( p_acl );
/*****************************************************************************
* HTTPClose: Stop the internal HTTP server
*****************************************************************************/
-void E_(HTTPClose)( access_t *p_access )
+void HTTPClose( access_t *p_access )
{
access_sys_t *p_sys = p_access->p_sys;
{
/* Unlock the thread if it is stuck in HttpCallback */
vlc_mutex_lock( &p_sys->httpd_mutex );
- if ( p_sys->b_request_frontend_info == VLC_TRUE )
+ if ( p_sys->b_request_frontend_info == true )
{
- p_sys->b_request_frontend_info = VLC_FALSE;
+ p_sys->b_request_frontend_info = false;
p_sys->psz_frontend_info = strdup("");
}
- if ( p_sys->b_request_mmi_info == VLC_TRUE )
+ if ( p_sys->b_request_mmi_info == true )
{
- p_sys->b_request_mmi_info = VLC_FALSE;
+ p_sys->b_request_mmi_info = false;
p_sys->psz_mmi_info = strdup("");
}
vlc_cond_signal( &p_sys->httpd_cond );
uint8_t *_psz_request,
uint8_t **_pp_data, int *pi_data )
{
+ VLC_UNUSED(p_file);
access_sys_t *p_sys = p_args->p_access->p_sys;
char *psz_request = (char *)_psz_request;
char **pp_data = (char **)_pp_data;
vlc_mutex_lock( &p_sys->httpd_mutex );
- p_sys->i_httpd_timeout = mdate() + I64C(3000000); /* 3 s */
+ p_sys->i_httpd_timeout = mdate() + INT64_C(3000000); /* 3 s */
p_sys->psz_request = psz_request;
- p_sys->b_request_frontend_info = VLC_TRUE;
+ p_sys->b_request_frontend_info = true;
if ( p_sys->i_ca_handle )
{
- p_sys->b_request_mmi_info = VLC_TRUE;
+ p_sys->b_request_mmi_info = true;
}
else
{
/****************************************************************************
* HTTPExtractValue: Extract a GET variable from psz_request
****************************************************************************/
-char *E_(HTTPExtractValue)( char *psz_uri, const char *psz_name,
- char *psz_value, int i_value_max )
+const char *HTTPExtractValue( const char *psz_uri, const char *psz_name,
+ char *psz_value, int i_value_max )
{
- char *p = psz_uri;
+ const char *p = psz_uri;
while( (p = strstr( p, psz_name )) )
{