Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
e578075a
Commit
e578075a
authored
Sep 24, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Phony error if old HTTP output syntax is used and avoid strdup()
parent
047f654a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
modules/access_output/http.c
modules/access_output/http.c
+13
-14
No files found.
modules/access_output/http.c
View file @
e578075a
...
@@ -131,7 +131,6 @@ static int Open( vlc_object_t *p_this )
...
@@ -131,7 +131,6 @@ static int Open( vlc_object_t *p_this )
sout_access_out_t
*
p_access
=
(
sout_access_out_t
*
)
p_this
;
sout_access_out_t
*
p_access
=
(
sout_access_out_t
*
)
p_this
;
sout_access_out_sys_t
*
p_sys
;
sout_access_out_sys_t
*
p_sys
;
char
*
psz_file_name
;
char
*
psz_user
;
char
*
psz_user
;
char
*
psz_pwd
;
char
*
psz_pwd
;
char
*
psz_mime
;
char
*
psz_mime
;
...
@@ -142,12 +141,17 @@ static int Open( vlc_object_t *p_this )
...
@@ -142,12 +141,17 @@ static int Open( vlc_object_t *p_this )
config_ChainParse
(
p_access
,
SOUT_CFG_PREFIX
,
ppsz_sout_options
,
p_access
->
p_cfg
);
config_ChainParse
(
p_access
,
SOUT_CFG_PREFIX
,
ppsz_sout_options
,
p_access
->
p_cfg
);
const
char
*
path
=
p_access
->
psz_path
;
/* Skip everything before / - backward compatibiltiy with VLC 1.1 */
/* Skip everything before / - backward compatibiltiy with VLC 1.1 */
const
char
*
psz_parser
=
strchr
(
p_access
->
psz_path
,
'/'
);
path
+=
strcspn
(
path
,
"/"
);
if
(
psz_parser
)
if
(
path
>
p_access
->
psz_path
)
psz_file_name
=
strdup
(
psz_parser
);
{
else
msg_Err
(
p_access
,
"
\"
%.*s
\"
HTTP host specification ignored"
,
psz_file_name
=
strdup
(
"/"
);
path
-
p_access
->
psz_path
,
p_access
->
psz_path
);
msg_Info
(
p_access
,
"(Use --http-host and/or --http-port instead.)"
);
}
if
(
!*
path
)
path
=
"/"
;
/* TLS support */
/* TLS support */
if
(
p_access
->
psz_access
&&
!
strcmp
(
p_access
->
psz_access
,
"https"
)
)
if
(
p_access
->
psz_access
&&
!
strcmp
(
p_access
->
psz_access
,
"https"
)
)
...
@@ -158,7 +162,6 @@ static int Open( vlc_object_t *p_this )
...
@@ -158,7 +162,6 @@ static int Open( vlc_object_t *p_this )
if
(
p_sys
->
p_httpd_host
==
NULL
)
if
(
p_sys
->
p_httpd_host
==
NULL
)
{
{
msg_Err
(
p_access
,
"cannot start HTTP server"
);
msg_Err
(
p_access
,
"cannot start HTTP server"
);
free
(
psz_file_name
);
free
(
p_sys
);
free
(
p_sys
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -175,7 +178,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -175,7 +178,7 @@ static int Open( vlc_object_t *p_this )
}
}
p_sys
->
p_httpd_stream
=
p_sys
->
p_httpd_stream
=
httpd_StreamNew
(
p_sys
->
p_httpd_host
,
p
sz_file_name
,
psz_mime
,
httpd_StreamNew
(
p_sys
->
p_httpd_host
,
p
ath
,
psz_mime
,
psz_user
,
psz_pwd
,
NULL
);
psz_user
,
psz_pwd
,
NULL
);
free
(
psz_user
);
free
(
psz_user
);
free
(
psz_pwd
);
free
(
psz_pwd
);
...
@@ -183,10 +186,9 @@ static int Open( vlc_object_t *p_this )
...
@@ -183,10 +186,9 @@ static int Open( vlc_object_t *p_this )
if
(
p_sys
->
p_httpd_stream
==
NULL
)
if
(
p_sys
->
p_httpd_stream
==
NULL
)
{
{
msg_Err
(
p_access
,
"cannot add stream %s"
,
p
sz_file_name
);
msg_Err
(
p_access
,
"cannot add stream %s"
,
p
ath
);
httpd_HostDelete
(
p_sys
->
p_httpd_host
);
httpd_HostDelete
(
p_sys
->
p_httpd_host
);
free
(
psz_file_name
);
free
(
p_sys
);
free
(
p_sys
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -203,8 +205,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -203,8 +205,7 @@ static int Open( vlc_object_t *p_this )
if( psz_name != NULL ) psz_name++;
if( psz_name != NULL ) psz_name++;
else psz_name = psz_newuri;
else psz_name = psz_newuri;
if( psz_file_name &&
if( asprintf( &psz_txt, "path=%s", path ) == -1 )
asprintf( &psz_txt, "path=%s", psz_file_name ) == -1 )
{
{
free( psz_uri );
free( psz_uri );
return VLC_ENOMEM;
return VLC_ENOMEM;
...
@@ -224,8 +225,6 @@ static int Open( vlc_object_t *p_this )
...
@@ -224,8 +225,6 @@ static int Open( vlc_object_t *p_this )
p_sys->p_bonjour = NULL;
p_sys->p_bonjour = NULL;
#endif
#endif
free
(
psz_file_name
);
p_sys
->
i_header_allocated
=
1024
;
p_sys
->
i_header_allocated
=
1024
;
p_sys
->
i_header_size
=
0
;
p_sys
->
i_header_size
=
0
;
p_sys
->
p_header
=
xmalloc
(
p_sys
->
i_header_allocated
);
p_sys
->
p_header
=
xmalloc
(
p_sys
->
i_header_allocated
);
...
...
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