Changeset 00aa3ff1c3da442f986b51f2277936d6629b1666

Show
Ignore:
Timestamp:
09/16/07 10:29:09 (1 year ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1189931349 +0000
git-parent:

[d1503b1298211fcebabc8e19cc647485e0464356]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1189931349 +0000
Message:

GetNonEmptyString? simplification

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access/dvb/http.c

    rd3fe7f2 r00aa3ff  
    9292    p_sys->i_httpd_timeout = 0; 
    9393 
    94     psz_address = var_GetString( p_access, "dvb-http-host" ); 
    95     if( psz_address != NULL && *psz_address
     94    psz_address = var_GetNonEmptyString( p_access, "dvb-http-host" ); 
     95    if( psz_address != NULL
    9696    { 
    9797        char *psz_parser = strchr( psz_address, ':' ); 
     
    103103    } 
    104104    else 
    105     { 
    106         if ( psz_address != NULL ) free( psz_address ); 
    107105        return VLC_SUCCESS; 
    108     } 
    109106 
    110107    /* determine SSL configuration */ 
    111     psz_cert = var_GetString( p_access, "dvb-http-intf-cert" ); 
    112     if ( psz_cert != NULL && *psz_cert
     108    psz_cert = var_GetNonEmptyString( p_access, "dvb-http-intf-cert" ); 
     109    if ( psz_cert != NULL
    113110    { 
    114111        msg_Dbg( p_access, "enabling TLS for HTTP interface (cert file: %s)", 
     
    123120    else 
    124121    { 
    125         if ( !*psz_cert ) 
    126         { 
    127             free( psz_cert ); 
    128             psz_cert = NULL; 
    129         } 
    130122        if ( i_port <= 0 ) 
    131123            i_port= 8082; 
     
    141133                                            i_port, psz_cert, psz_key, psz_ca, 
    142134                                            psz_crl ); 
    143     FREE( psz_cert ); 
    144     FREE( psz_key ); 
    145     FREE( psz_ca ); 
    146     FREE( psz_crl ); 
     135    free( psz_cert ); 
     136    free( psz_key ); 
     137    free( psz_ca ); 
     138    free( psz_crl ); 
    147139 
    148140    if ( p_sys->p_httpd_host == NULL ) 
     
    176168                               HttpCallback, f ); 
    177169 
    178     FREE( psz_user ); 
    179     FREE( psz_password ); 
    180     FREE( psz_acl ); 
     170    free( psz_user ); 
     171    free( psz_password ); 
     172    free( psz_acl ); 
    181173    if ( p_acl != NULL ) 
    182174        ACL_Destroy( p_acl ); 
  • modules/access_filter/timeshift.c

    r7dd2f15 r00aa3ff  
    556556static char *GetTmpFilePath( access_t *p_access ) 
    557557{ 
    558     char *psz_dir = var_GetString( p_access, "timeshift-dir" ); 
     558    char *psz_dir = var_GetNonEmptyString( p_access, "timeshift-dir" ); 
    559559    char *psz_filename_base; 
    560  
    561     if( ( psz_dir != NULL ) && ( psz_dir[0] == '\0' ) ) 
    562     { 
    563         free( psz_dir ); 
    564         psz_dir = NULL; 
    565     } 
    566560 
    567561    if( psz_dir == NULL ) 
  • modules/control/http/http.c

    r6a8601d r00aa3ff  
    137137    char          *psz_src; 
    138138 
    139     var_Create(p_intf->p_libvlc, "http-host", VLC_VAR_STRING ); 
    140     psz_address = var_GetString(p_intf->p_libvlc, "http-host"); 
    141     if( !psz_address || !*psz_address ) 
    142     { 
    143         psz_address = config_GetPsz( p_intf, "http-host" ); 
    144     } 
     139    psz_address = var_GetNonEmptyString(p_intf->p_libvlc, "http-host"); 
    145140    if( psz_address != NULL ) 
    146141    { 
     
    261256        msg_Dbg( p_intf, "enabling TLS for HTTP interface (cert file: %s)", 
    262257                 psz_cert ); 
    263         psz_key = config_GetPsz( p_intf, "http-intf-key" ); 
    264         psz_ca = config_GetPsz( p_intf, "http-intf-ca" ); 
    265         psz_crl = config_GetPsz( p_intf, "http-intf-crl" ); 
     258        psz_key = var_GetNonEmptyString( p_intf, "http-intf-key" ); 
     259        psz_ca = var_GetNonEmptyString( p_intf, "http-intf-ca" ); 
     260        psz_crl = var_GetNonEmptyString( p_intf, "http-intf-crl" ); 
    266261 
    267262        if( i_port <= 0 ) 
     
    293288        /* Ugly hack to run several HTTP servers on different ports */ 
    294289        snprintf( psz_tmp, sizeof (psz_tmp), "%s:%d", psz_address, i_port + 1 ); 
     290        var_Create(p_intf->p_libvlc, "http-host", VLC_VAR_STRING ); 
    295291        var_SetString( p_intf->p_libvlc, "http-host", psz_tmp ); 
    296292    } 
     
    380376 
    381377failed: 
    382     if( psz_src ) free( psz_src ); 
    383     if( p_sys->pp_files ) 
    384     { 
    385         free( p_sys->pp_files ); 
    386     } 
     378    free( psz_src ); 
     379    free( p_sys->pp_files ); 
    387380    httpd_HostDelete( p_sys->p_httpd_host ); 
    388381    free( p_sys->psz_address );