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
072e04e9
Commit
072e04e9
authored
Dec 18, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
https: insecure HTTP support for file download layer
parent
9911e583
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
17 deletions
+24
-17
modules/access/http/access.c
modules/access/http/access.c
+2
-2
modules/access/http/file.c
modules/access/http/file.c
+22
-15
No files found.
modules/access/http/access.c
View file @
072e04e9
...
...
@@ -195,12 +195,12 @@ static void Close(vlc_object_t *obj)
}
vlc_module_begin
()
set_description
(
N_
(
"HTTP
/TL
S input"
))
set_description
(
N_
(
"HTTPS input"
))
set_shortname
(
N_
(
"HTTPS"
))
set_category
(
CAT_INPUT
)
set_subcategory
(
SUBCAT_INPUT_ACCESS
)
set_capability
(
"access"
,
2
)
add_shortcut
(
"https"
)
add_shortcut
(
"https"
,
"http"
)
set_callbacks
(
Open
,
Close
)
add_bool
(
"http2"
,
false
,
N_
(
"Force HTTP/2"
),
...
...
modules/access/http/file.c
View file @
072e04e9
...
...
@@ -46,6 +46,7 @@ struct vlc_http_file
struct
vlc_http_msg
*
resp
;
char
*
host
;
unsigned
port
;
bool
secure
;
char
*
authority
;
char
*
path
;
char
*
agent
;
...
...
@@ -60,7 +61,8 @@ static struct vlc_http_msg *vlc_http_file_req(const struct vlc_http_file *file,
struct
vlc_http_msg
*
req
;
const
char
*
str
;
req
=
vlc_http_req_create
(
"GET"
,
"https"
,
file
->
authority
,
file
->
path
);
req
=
vlc_http_req_create
(
"GET"
,
file
->
secure
?
"https"
:
"http"
,
file
->
authority
,
file
->
path
);
if
(
unlikely
(
req
==
NULL
))
return
NULL
;
...
...
@@ -121,8 +123,8 @@ static struct vlc_http_msg *vlc_http_file_open(struct vlc_http_file *file,
if
(
unlikely
(
req
==
NULL
))
return
NULL
;
struct
vlc_http_msg
*
resp
=
vlc_http_mgr_request
(
file
->
manager
,
true
,
file
->
host
,
file
->
port
,
req
);
struct
vlc_http_msg
*
resp
=
vlc_http_mgr_request
(
file
->
manager
,
file
->
secure
,
file
->
host
,
file
->
port
,
req
);
vlc_http_msg_destroy
(
req
);
resp
=
vlc_http_msg_get_final
(
resp
);
...
...
@@ -189,23 +191,24 @@ struct vlc_http_file *vlc_http_file_create(struct vlc_http_mgr *mgr,
const
char
*
ref
)
{
vlc_url_t
url
;
bool
secure
;
vlc_UrlParse
(
&
url
,
uri
);
if
(
url
.
psz_protocol
==
NULL
||
vlc_ascii_strcasecmp
(
url
.
psz_protocol
,
"https"
)
||
url
.
psz_host
==
NULL
)
{
vlc_UrlClean
(
&
url
);
return
NULL
;
}
if
(
url
.
psz_protocol
==
NULL
||
url
.
psz_host
==
NULL
)
goto
error
;
if
(
!
vlc_ascii_strcasecmp
(
url
.
psz_protocol
,
"https"
))
secure
=
true
;
else
if
(
!
vlc_ascii_strcasecmp
(
url
.
psz_protocol
,
"http"
))
secure
=
false
;
else
goto
error
;
struct
vlc_http_file
*
file
=
malloc
(
sizeof
(
*
file
));
if
(
unlikely
(
file
==
NULL
))
{
vlc_UrlClean
(
&
url
);
return
NULL
;
}
goto
error
;
file
->
secure
=
secure
;
file
->
host
=
strdup
(
url
.
psz_host
);
file
->
port
=
url
.
i_port
;
file
->
authority
=
vlc_http_authority
(
url
.
psz_host
,
url
.
i_port
);
...
...
@@ -236,6 +239,9 @@ struct vlc_http_file *vlc_http_file_create(struct vlc_http_mgr *mgr,
file
=
NULL
;
}
return
file
;
error:
vlc_UrlClean
(
&
url
);
return
NULL
;
}
int
vlc_http_file_get_status
(
struct
vlc_http_file
*
file
)
...
...
@@ -278,7 +284,8 @@ char *vlc_http_file_get_redirect(struct vlc_http_file *file)
{
char
*
url
;
if
(
unlikely
(
asprintf
(
&
url
,
"https://%s%.*s"
,
file
->
authority
,
if
(
unlikely
(
asprintf
(
&
url
,
"%s://%s%.*s"
,
file
->
secure
?
"https"
:
"http"
,
file
->
authority
,
(
int
)
len
,
location
))
<
0
)
return
NULL
;
return
url
;
...
...
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