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
f0393c52
Commit
f0393c52
authored
Mar 25, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua intf: minor MakeConfig() fixes
parent
2cddef04
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
22 deletions
+35
-22
modules/lua/intf.c
modules/lua/intf.c
+35
-22
No files found.
modules/lua/intf.c
View file @
f0393c52
...
@@ -61,64 +61,77 @@ static char *MakeConfig( intf_thread_t *p_intf, const char *name )
...
@@ -61,64 +61,77 @@ static char *MakeConfig( intf_thread_t *p_intf, const char *name )
if
(
!
strcmp
(
name
,
"http"
)
)
if
(
!
strcmp
(
name
,
"http"
)
)
{
{
char
*
psz_http_src
=
var_
CreateGetNonEmpty
String
(
p_intf
,
"http-src"
);
char
*
psz_http_src
=
var_
Inherit
String
(
p_intf
,
"http-src"
);
bool
b_http_index
=
var_
CreateGe
tBool
(
p_intf
,
"http-index"
);
bool
b_http_index
=
var_
Inheri
tBool
(
p_intf
,
"http-index"
);
if
(
psz_http_src
)
if
(
psz_http_src
)
{
{
char
*
psz_esc
=
config_StringEscape
(
psz_http_src
);
char
*
psz_esc
=
config_StringEscape
(
psz_http_src
);
asprintf
(
&
psz_config
,
"http={dir='%s',no_index=%s}"
,
psz_esc
,
b_http_index
?
"true"
:
"false"
);
if
(
asprintf
(
&
psz_config
,
"http={dir='%s',no_index=%s}"
,
psz_esc
,
b_http_index
?
"true"
:
"false"
)
==
-
1
)
psz_config
=
NULL
;
free
(
psz_esc
);
free
(
psz_esc
);
free
(
psz_http_src
);
free
(
psz_http_src
);
}
}
else
else
asprintf
(
&
psz_config
,
"http={no_index=%s}"
,
b_http_index
?
"true"
:
"false"
);
{
if
(
asprintf
(
&
psz_config
,
"http={no_index=%s}"
,
b_http_index
?
"true"
:
"false"
)
==
-
1
)
psz_config
=
NULL
;
}
}
}
else
if
(
!
strcmp
(
name
,
"telnet"
)
)
else
if
(
!
strcmp
(
name
,
"telnet"
)
)
{
{
char
*
psz_
telnet_host
=
var_CreateGe
tString
(
p_intf
,
"telnet-host"
);
char
*
psz_
host
=
var_Inheri
tString
(
p_intf
,
"telnet-host"
);
if
(
!
strcmp
(
psz_
telnet_
host
,
"*console"
)
)
if
(
!
strcmp
(
psz_host
,
"*console"
)
)
;
;
else
else
{
{
vlc_url_t
url
;
vlc_url_t
url
;
vlc_UrlParse
(
&
url
,
psz_
telnet_
host
,
0
);
vlc_UrlParse
(
&
url
,
psz_host
,
0
);
int
i_
telnet_port
=
var_CreateGe
tInteger
(
p_intf
,
"telnet-port"
);
int
i_
port
=
var_Inheri
tInteger
(
p_intf
,
"telnet-port"
);
if
(
url
.
i_port
!=
0
)
if
(
url
.
i_port
!=
0
)
{
{
if
(
i_telnet_port
==
TELNETPORT_DEFAULT
)
if
(
i_port
==
TELNETPORT_DEFAULT
)
i_telnet_port
=
url
.
i_port
;
i_port
=
url
.
i_port
;
else
if
(
url
.
i_port
!=
i_telnet_port
)
else
if
(
url
.
i_port
!=
i_port
)
msg_Warn
(
p_intf
,
"ignoring port %d (using %d)"
,
url
.
i_port
,
i_telnet_port
);
msg_Warn
(
p_intf
,
"ignoring port %d (using %d)"
,
url
.
i_port
,
i_port
);
}
}
char
*
psz_esc_host
=
config_StringEscape
(
url
.
psz_host
);
char
*
psz_esc_host
=
config_StringEscape
(
url
.
psz_host
);
free
(
psz_
telnet_
host
);
free
(
psz_host
);
vlc_UrlClean
(
&
url
);
vlc_UrlClean
(
&
url
);
asprintf
(
&
psz_telnet_host
,
"telnet://%s:%d"
,
psz_esc_host
?
psz_esc_host
:
""
,
i_telnet_port
);
if
(
asprintf
(
&
psz_host
,
"telnet://%s:%d"
,
psz_esc_host
?
psz_esc_host
:
""
,
i_port
)
==
-
1
)
psz_host
=
NULL
;
free
(
psz_esc_host
);
free
(
psz_esc_host
);
}
}
char
*
psz_
telnet_passwd
=
var_CreateGe
tString
(
p_intf
,
"telnet-password"
);
char
*
psz_
passwd
=
var_Inheri
tString
(
p_intf
,
"telnet-password"
);
char
*
psz_esc_passwd
=
config_StringEscape
(
psz_
telnet_
passwd
);
char
*
psz_esc_passwd
=
config_StringEscape
(
psz_passwd
);
asprintf
(
&
psz_config
,
"telnet={host='%s',password='%s'}"
,
psz_telnet_host
,
psz_esc_passwd
);
if
(
asprintf
(
&
psz_config
,
"telnet={host='%s',password='%s'}"
,
psz_host
,
psz_esc_passwd
)
==
-
1
)
psz_config
=
NULL
;
free
(
psz_esc_passwd
);
free
(
psz_esc_passwd
);
free
(
psz_
telnet_
passwd
);
free
(
psz_passwd
);
free
(
psz_
telnet_
host
);
free
(
psz_host
);
}
}
else
if
(
!
strcmp
(
name
,
"cli"
)
)
else
if
(
!
strcmp
(
name
,
"cli"
)
)
{
{
char
*
psz_rc_host
=
var_
CreateGetNonEmpty
String
(
p_intf
,
"rc-host"
);
char
*
psz_rc_host
=
var_
Inherit
String
(
p_intf
,
"rc-host"
);
if
(
!
psz_rc_host
)
if
(
!
psz_rc_host
)
psz_rc_host
=
var_
CreateGetNonEmpty
String
(
p_intf
,
"cli-host"
);
psz_rc_host
=
var_
Inherit
String
(
p_intf
,
"cli-host"
);
if
(
psz_rc_host
)
if
(
psz_rc_host
)
{
{
char
*
psz_esc_host
=
config_StringEscape
(
psz_rc_host
);
char
*
psz_esc_host
=
config_StringEscape
(
psz_rc_host
);
asprintf
(
&
psz_config
,
"cli={host='%s'}"
,
psz_esc_host
);
if
(
asprintf
(
&
psz_config
,
"cli={host='%s'}"
,
psz_esc_host
)
==
-
1
)
psz_config
=
NULL
;
free
(
psz_esc_host
);
free
(
psz_esc_host
);
free
(
psz_rc_host
);
free
(
psz_rc_host
);
}
}
...
...
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