Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
00aa3ff1
Commit
00aa3ff1
authored
Sep 16, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GetNonEmptyString simplification
parent
d1503b12
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
40 deletions
+19
-40
modules/access/dvb/http.c
modules/access/dvb/http.c
+11
-19
modules/access_filter/timeshift.c
modules/access_filter/timeshift.c
+1
-7
modules/control/http/http.c
modules/control/http/http.c
+7
-14
No files found.
modules/access/dvb/http.c
View file @
00aa3ff1
...
...
@@ -91,8 +91,8 @@ int E_(HTTPOpen)( access_t *p_access )
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_Get
NonEmpty
String
(
p_access
,
"dvb-http-host"
);
if
(
psz_address
!=
NULL
)
{
char
*
psz_parser
=
strchr
(
psz_address
,
':'
);
if
(
psz_parser
)
...
...
@@ -102,14 +102,11 @@ int E_(HTTPOpen)( access_t *p_access )
}
}
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_Get
NonEmpty
String
(
p_access
,
"dvb-http-intf-cert"
);
if
(
psz_cert
!=
NULL
)
{
msg_Dbg
(
p_access
,
"enabling TLS for HTTP interface (cert file: %s)"
,
psz_cert
);
...
...
@@ -122,11 +119,6 @@ int E_(HTTPOpen)( access_t *p_access )
}
else
{
if
(
!*
psz_cert
)
{
free
(
psz_cert
);
psz_cert
=
NULL
;
}
if
(
i_port
<=
0
)
i_port
=
8082
;
}
...
...
@@ -140,10 +132,10 @@ int E_(HTTPOpen)( access_t *p_access )
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
)
{
...
...
@@ -175,9 +167,9 @@ int E_(HTTPOpen)( access_t *p_access )
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
);
...
...
modules/access_filter/timeshift.c
View file @
00aa3ff1
...
...
@@ -555,15 +555,9 @@ static int Control( access_t *p_access, int i_query, va_list args )
#endif
static
char
*
GetTmpFilePath
(
access_t
*
p_access
)
{
char
*
psz_dir
=
var_GetString
(
p_access
,
"timeshift-dir"
);
char
*
psz_dir
=
var_Get
NonEmpty
String
(
p_access
,
"timeshift-dir"
);
char
*
psz_filename_base
;
if
(
(
psz_dir
!=
NULL
)
&&
(
psz_dir
[
0
]
==
'\0'
)
)
{
free
(
psz_dir
);
psz_dir
=
NULL
;
}
if
(
psz_dir
==
NULL
)
{
#ifdef WIN32
...
...
modules/control/http/http.c
View file @
00aa3ff1
...
...
@@ -136,12 +136,7 @@ static int Open( vlc_object_t *p_this )
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
,
':'
);
...
...
@@ -260,9 +255,9 @@ static int Open( vlc_object_t *p_this )
{
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
;
...
...
@@ -292,6 +287,7 @@ static int Open( vlc_object_t *p_this )
/* 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
);
}
...
...
@@ -379,11 +375,8 @@ static int Open( vlc_object_t *p_this )
return
VLC_SUCCESS
;
failed:
if
(
psz_src
)
free
(
psz_src
);
if
(
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment