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
064c638a
Commit
064c638a
authored
Jul 04, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an infinite loop if we redirect from http to https (or contrary).
parent
220f75c8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
11 deletions
+25
-11
modules/access/http.c
modules/access/http.c
+25
-11
No files found.
modules/access/http.c
View file @
064c638a
...
...
@@ -205,7 +205,8 @@ struct access_sys_t
};
/* */
static
int
OpenWithCookies
(
vlc_object_t
*
p_this
,
vlc_array_t
*
cookies
);
static
int
OpenWithCookies
(
vlc_object_t
*
p_this
,
const
char
*
psz_access
,
vlc_array_t
*
cookies
);
/* */
static
ssize_t
Read
(
access_t
*
,
uint8_t
*
,
size_t
);
...
...
@@ -238,10 +239,20 @@ static void AuthReset( http_auth_t *p_auth );
*****************************************************************************/
static
int
Open
(
vlc_object_t
*
p_this
)
{
return
OpenWithCookies
(
p_this
,
NULL
);
access_t
*
p_access
=
(
access_t
*
)
p_this
;
return
OpenWithCookies
(
p_this
,
p_access
->
psz_access
,
NULL
);
}
static
int
OpenWithCookies
(
vlc_object_t
*
p_this
,
vlc_array_t
*
cookies
)
/**
* Open the given url using the given cookies
* @param p_this: the vlc object
* @psz_access: the acces to use (http, https, ...) (this value must be used
* instead of p_access->psz_access)
* @cookies: the available cookies
* @return vlc error codes
*/
static
int
OpenWithCookies
(
vlc_object_t
*
p_this
,
const
char
*
psz_access
,
vlc_array_t
*
cookies
)
{
access_t
*
p_access
=
(
access_t
*
)
p_this
;
access_sys_t
*
p_sys
;
...
...
@@ -305,7 +316,7 @@ static int OpenWithCookies( vlc_object_t *p_this, vlc_array_t *cookies )
msg_Warn
(
p_access
,
"invalid host"
);
goto
error
;
}
if
(
!
strncmp
(
p
_access
->
p
sz_access
,
"https"
,
5
)
)
if
(
!
strncmp
(
psz_access
,
"https"
,
5
)
)
{
/* HTTP over SSL */
p_sys
->
b_ssl
=
true
;
...
...
@@ -337,7 +348,7 @@ static int OpenWithCookies( vlc_object_t *p_this, vlc_array_t *cookies )
{
char
*
buf
;
int
i
;
i
=
asprintf
(
&
buf
,
"%s://%s"
,
p
_access
->
p
sz_access
,
p_access
->
psz_path
);
i
=
asprintf
(
&
buf
,
"%s://%s"
,
psz_access
,
p_access
->
psz_path
);
if
(
i
>=
0
)
{
msg_Dbg
(
p_access
,
"asking libproxy about url '%s'"
,
buf
);
...
...
@@ -473,9 +484,12 @@ connect:
msg_Dbg
(
p_access
,
"redirection to %s"
,
p_sys
->
psz_location
);
/* Do not accept redirection outside of HTTP works */
if
(
strncmp
(
p_sys
->
psz_location
,
"http"
,
4
)
||
(
(
p_sys
->
psz_location
[
4
]
!=
':'
)
/* HTTP */
&&
strncmp
(
p_sys
->
psz_location
+
4
,
"s:"
,
2
)
/* HTTP/SSL */
)
)
const
char
*
psz_protocol
;
if
(
!
strncmp
(
p_sys
->
psz_location
,
"http:"
,
5
)
)
psz_protocol
=
"http"
;
else
if
(
!
strncmp
(
p_sys
->
psz_location
,
"https:"
,
6
)
)
psz_protocol
=
"https"
;
else
{
msg_Err
(
p_access
,
"insecure redirection ignored"
);
goto
error
;
...
...
@@ -501,7 +515,7 @@ connect:
free
(
p_sys
);
/* Do new Open() run with new data */
return
OpenWithCookies
(
p_this
,
cookies
);
return
OpenWithCookies
(
p_this
,
psz_protocol
,
cookies
);
}
if
(
p_sys
->
b_mms
)
...
...
@@ -549,7 +563,7 @@ connect:
}
/* else probably Ogg Vorbis */
}
else
if
(
!
strcasecmp
(
p
_access
->
p
sz_access
,
"unsv"
)
&&
else
if
(
!
strcasecmp
(
psz_access
,
"unsv"
)
&&
p_sys
->
psz_mime
&&
!
strcasecmp
(
p_sys
->
psz_mime
,
"misc/ultravox"
)
)
{
...
...
@@ -557,7 +571,7 @@ connect:
/* Grrrr! detect ultravox server and force NSV demuxer */
p_access
->
psz_demux
=
strdup
(
"nsv"
);
}
else
if
(
!
strcmp
(
p
_access
->
p
sz_access
,
"itpc"
)
)
else
if
(
!
strcmp
(
psz_access
,
"itpc"
)
)
{
free
(
p_access
->
psz_demux
);
p_access
->
psz_demux
=
strdup
(
"podcast"
);
...
...
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