Changeset 00aa3ff1c3da442f986b51f2277936d6629b1666
- 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
| rd3fe7f2 |
r00aa3ff |
|
| 92 | 92 | p_sys->i_httpd_timeout = 0; |
|---|
| 93 | 93 | |
|---|
| 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 ) |
|---|
| 96 | 96 | { |
|---|
| 97 | 97 | char *psz_parser = strchr( psz_address, ':' ); |
|---|
| … | … | |
| 103 | 103 | } |
|---|
| 104 | 104 | else |
|---|
| 105 | | { |
|---|
| 106 | | if ( psz_address != NULL ) free( psz_address ); |
|---|
| 107 | 105 | return VLC_SUCCESS; |
|---|
| 108 | | } |
|---|
| 109 | 106 | |
|---|
| 110 | 107 | /* 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 ) |
|---|
| 113 | 110 | { |
|---|
| 114 | 111 | msg_Dbg( p_access, "enabling TLS for HTTP interface (cert file: %s)", |
|---|
| … | … | |
| 123 | 120 | else |
|---|
| 124 | 121 | { |
|---|
| 125 | | if ( !*psz_cert ) |
|---|
| 126 | | { |
|---|
| 127 | | free( psz_cert ); |
|---|
| 128 | | psz_cert = NULL; |
|---|
| 129 | | } |
|---|
| 130 | 122 | if ( i_port <= 0 ) |
|---|
| 131 | 123 | i_port= 8082; |
|---|
| … | … | |
| 141 | 133 | i_port, psz_cert, psz_key, psz_ca, |
|---|
| 142 | 134 | 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 ); |
|---|
| 147 | 139 | |
|---|
| 148 | 140 | if ( p_sys->p_httpd_host == NULL ) |
|---|
| … | … | |
| 176 | 168 | HttpCallback, f ); |
|---|
| 177 | 169 | |
|---|
| 178 | | FREE( psz_user ); |
|---|
| 179 | | FREE( psz_password ); |
|---|
| 180 | | FREE( psz_acl ); |
|---|
| | 170 | free( psz_user ); |
|---|
| | 171 | free( psz_password ); |
|---|
| | 172 | free( psz_acl ); |
|---|
| 181 | 173 | if ( p_acl != NULL ) |
|---|
| 182 | 174 | ACL_Destroy( p_acl ); |
|---|
| r7dd2f15 |
r00aa3ff |
|
| 556 | 556 | static char *GetTmpFilePath( access_t *p_access ) |
|---|
| 557 | 557 | { |
|---|
| 558 | | char *psz_dir = var_GetString( p_access, "timeshift-dir" ); |
|---|
| | 558 | char *psz_dir = var_GetNonEmptyString( p_access, "timeshift-dir" ); |
|---|
| 559 | 559 | char *psz_filename_base; |
|---|
| 560 | | |
|---|
| 561 | | if( ( psz_dir != NULL ) && ( psz_dir[0] == '\0' ) ) |
|---|
| 562 | | { |
|---|
| 563 | | free( psz_dir ); |
|---|
| 564 | | psz_dir = NULL; |
|---|
| 565 | | } |
|---|
| 566 | 560 | |
|---|
| 567 | 561 | if( psz_dir == NULL ) |
|---|
| r6a8601d |
r00aa3ff |
|
| 137 | 137 | char *psz_src; |
|---|
| 138 | 138 | |
|---|
| 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"); |
|---|
| 145 | 140 | if( psz_address != NULL ) |
|---|
| 146 | 141 | { |
|---|
| … | … | |
| 261 | 256 | msg_Dbg( p_intf, "enabling TLS for HTTP interface (cert file: %s)", |
|---|
| 262 | 257 | 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" ); |
|---|
| 266 | 261 | |
|---|
| 267 | 262 | if( i_port <= 0 ) |
|---|
| … | … | |
| 293 | 288 | /* Ugly hack to run several HTTP servers on different ports */ |
|---|
| 294 | 289 | 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 ); |
|---|
| 295 | 291 | var_SetString( p_intf->p_libvlc, "http-host", psz_tmp ); |
|---|
| 296 | 292 | } |
|---|
| … | … | |
| 380 | 376 | |
|---|
| 381 | 377 | failed: |
|---|
| 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 ); |
|---|
| 387 | 380 | httpd_HostDelete( p_sys->p_httpd_host ); |
|---|
| 388 | 381 | free( p_sys->psz_address ); |
|---|