p_sys->b_request_frontend_info = p_sys->b_request_mmi_info = VLC_FALSE;
p_sys->i_httpd_timeout = 0;
- psz_address = var_GetString( p_access, "dvb-http-host" );
- if( psz_address != NULL && *psz_address )
+ psz_address = var_GetNonEmptyString( p_access, "dvb-http-host" );
+ if( psz_address != NULL )
{
char *psz_parser = strchr( psz_address, ':' );
if( psz_parser )
}
}
else
- {
- if ( psz_address != NULL ) free( psz_address );
return VLC_SUCCESS;
- }
/* determine SSL configuration */
- psz_cert = var_GetString( p_access, "dvb-http-intf-cert" );
- if ( psz_cert != NULL && *psz_cert )
+ psz_cert = var_GetNonEmptyString( p_access, "dvb-http-intf-cert" );
+ if ( psz_cert != NULL )
{
msg_Dbg( p_access, "enabling TLS for HTTP interface (cert file: %s)",
psz_cert );
}
else
{
- if ( !*psz_cert )
- {
- free( psz_cert );
- psz_cert = NULL;
- }
if ( i_port <= 0 )
i_port= 8082;
}
p_sys->p_httpd_host = httpd_TLSHostNew( VLC_OBJECT(p_access), psz_address,
i_port, psz_cert, psz_key, psz_ca,
psz_crl );
- FREE( psz_cert );
- FREE( psz_key );
- FREE( psz_ca );
- FREE( psz_crl );
+ free( psz_cert );
+ free( psz_key );
+ free( psz_ca );
+ free( psz_crl );
if ( p_sys->p_httpd_host == NULL )
{
psz_user, psz_password, p_acl,
HttpCallback, f );
- FREE( psz_user );
- FREE( psz_password );
- FREE( psz_acl );
+ free( psz_user );
+ free( psz_password );
+ free( psz_acl );
if ( p_acl != NULL )
ACL_Destroy( p_acl );
int i_port = 0;
char *psz_src;
- var_Create(p_intf->p_libvlc, "http-host", VLC_VAR_STRING );
- psz_address = var_GetString(p_intf->p_libvlc, "http-host");
- if( !psz_address || !*psz_address )
- {
- psz_address = config_GetPsz( p_intf, "http-host" );
- }
+ psz_address = var_GetNonEmptyString(p_intf->p_libvlc, "http-host");
if( psz_address != NULL )
{
char *psz_parser = strchr( psz_address, ':' );
{
msg_Dbg( p_intf, "enabling TLS for HTTP interface (cert file: %s)",
psz_cert );
- psz_key = config_GetPsz( p_intf, "http-intf-key" );
- psz_ca = config_GetPsz( p_intf, "http-intf-ca" );
- psz_crl = config_GetPsz( p_intf, "http-intf-crl" );
+ psz_key = var_GetNonEmptyString( p_intf, "http-intf-key" );
+ psz_ca = var_GetNonEmptyString( p_intf, "http-intf-ca" );
+ psz_crl = var_GetNonEmptyString( p_intf, "http-intf-crl" );
if( i_port <= 0 )
i_port = 8443;
/* Ugly hack to run several HTTP servers on different ports */
snprintf( psz_tmp, sizeof (psz_tmp), "%s:%d", psz_address, i_port + 1 );
+ var_Create(p_intf->p_libvlc, "http-host", VLC_VAR_STRING );
var_SetString( p_intf->p_libvlc, "http-host", psz_tmp );
}
return VLC_SUCCESS;
failed:
- if( psz_src ) free( psz_src );
- if( p_sys->pp_files )
- {
- free( p_sys->pp_files );
- }
+ free( psz_src );
+ free( p_sys->pp_files );
httpd_HostDelete( p_sys->p_httpd_host );
free( p_sys->psz_address );
free( p_sys->psz_html_type );