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
8826c29c
Commit
8826c29c
authored
Oct 22, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: fix initialization
parent
dbc8b781
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
modules/access/http.c
modules/access/http.c
+25
-10
No files found.
modules/access/http.c
View file @
8826c29c
...
@@ -230,15 +230,14 @@ static int OpenRedirected( vlc_object_t *p_this, const char *psz_url,
...
@@ -230,15 +230,14 @@ static int OpenRedirected( vlc_object_t *p_this, const char *psz_url,
unsigned
i_redirect
)
unsigned
i_redirect
)
{
{
access_t
*
p_access
=
(
access_t
*
)
p_this
;
access_t
*
p_access
=
(
access_t
*
)
p_this
;
access_sys_t
*
p_sys
;
char
*
psz
;
char
*
psz
;
/* Set up p_access */
access_sys_t
*
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
STANDARD_READ_ACCESS_INIT
;
if
(
unlikely
(
p_sys
==
NULL
)
)
#ifdef HAVE_ZLIB_H
return
VLC_ENOMEM
;
p_access
->
pf_read
=
ReadCompressed
;
#endif
p_sys
->
fd
=
-
1
;
p_sys
->
fd
=
-
1
;
p_sys
->
b_error
=
false
;
p_sys
->
b_proxy
=
false
;
p_sys
->
b_proxy
=
false
;
p_sys
->
psz_proxy_passbuf
=
NULL
;
p_sys
->
psz_proxy_passbuf
=
NULL
;
p_sys
->
i_version
=
1
;
p_sys
->
i_version
=
1
;
...
@@ -253,6 +252,7 @@ static int OpenRedirected( vlc_object_t *p_this, const char *psz_url,
...
@@ -253,6 +252,7 @@ static int OpenRedirected( vlc_object_t *p_this, const char *psz_url,
p_sys
->
b_pace_control
=
true
;
p_sys
->
b_pace_control
=
true
;
#ifdef HAVE_ZLIB_H
#ifdef HAVE_ZLIB_H
p_sys
->
b_compressed
=
false
;
p_sys
->
b_compressed
=
false
;
memset
(
&
p_sys
->
inflate
.
stream
,
0
,
sizeof
(
p_sys
->
inflate
.
stream
)
);
/* 15 is the max windowBits, +32 to enable optional gzip decoding */
/* 15 is the max windowBits, +32 to enable optional gzip decoding */
if
(
inflateInit2
(
&
p_sys
->
inflate
.
stream
,
32
+
15
)
!=
Z_OK
)
if
(
inflateInit2
(
&
p_sys
->
inflate
.
stream
,
32
+
15
)
!=
Z_OK
)
msg_Warn
(
p_access
,
"Error during zlib initialisation: %s"
,
msg_Warn
(
p_access
,
"Error during zlib initialisation: %s"
,
...
@@ -261,6 +261,7 @@ static int OpenRedirected( vlc_object_t *p_this, const char *psz_url,
...
@@ -261,6 +261,7 @@ static int OpenRedirected( vlc_object_t *p_this, const char *psz_url,
msg_Warn
(
p_access
,
"Your zlib was compiled without gzip support."
);
msg_Warn
(
p_access
,
"Your zlib was compiled without gzip support."
);
p_sys
->
inflate
.
p_buffer
=
NULL
;
p_sys
->
inflate
.
p_buffer
=
NULL
;
#endif
#endif
p_sys
->
p_creds
=
NULL
;
p_sys
->
p_tls
=
NULL
;
p_sys
->
p_tls
=
NULL
;
p_sys
->
i_icy_meta
=
0
;
p_sys
->
i_icy_meta
=
0
;
p_sys
->
i_icy_offset
=
0
;
p_sys
->
i_icy_offset
=
0
;
...
@@ -393,6 +394,7 @@ static int OpenRedirected( vlc_object_t *p_this, const char *psz_url,
...
@@ -393,6 +394,7 @@ static int OpenRedirected( vlc_object_t *p_this, const char *psz_url,
p_sys
->
b_reconnect
=
var_InheritBool
(
p_access
,
"http-reconnect"
);
p_sys
->
b_reconnect
=
var_InheritBool
(
p_access
,
"http-reconnect"
);
p_sys
->
b_continuous
=
var_InheritBool
(
p_access
,
"http-continuous"
);
p_sys
->
b_continuous
=
var_InheritBool
(
p_access
,
"http-continuous"
);
p_access
->
p_sys
=
p_sys
;
connect:
connect:
/* Connect */
/* Connect */
switch
(
Connect
(
p_access
,
0
)
)
switch
(
Connect
(
p_access
,
0
)
)
...
@@ -477,7 +479,8 @@ connect:
...
@@ -477,7 +479,8 @@ connect:
/* Clean up current Open() run */
/* Clean up current Open() run */
vlc_UrlClean
(
&
p_sys
->
url
);
vlc_UrlClean
(
&
p_sys
->
url
);
http_auth_Reset
(
&
p_sys
->
auth
);
http_auth_Reset
(
&
p_sys
->
auth
);
vlc_UrlClean
(
&
p_sys
->
proxy
);
if
(
p_sys
->
b_proxy
)
vlc_UrlClean
(
&
p_sys
->
proxy
);
free
(
p_sys
->
psz_proxy_passbuf
);
free
(
p_sys
->
psz_proxy_passbuf
);
http_auth_Reset
(
&
p_sys
->
proxy_auth
);
http_auth_Reset
(
&
p_sys
->
proxy_auth
);
free
(
p_sys
->
psz_mime
);
free
(
p_sys
->
psz_mime
);
...
@@ -507,11 +510,21 @@ connect:
...
@@ -507,11 +510,21 @@ connect:
if
(
p_sys
->
b_reconnect
)
msg_Dbg
(
p_access
,
"auto re-connect enabled"
);
if
(
p_sys
->
b_reconnect
)
msg_Dbg
(
p_access
,
"auto re-connect enabled"
);
/* Set up p_access */
#ifdef HAVE_ZLIB_H
p_access
->
pf_read
=
ReadCompressed
;
#else
p_access
->
pf_read
=
Read
;
#endif
p_access
->
pf_control
=
Control
;
p_access
->
pf_seek
=
Seek
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
error:
error:
vlc_UrlClean
(
&
p_sys
->
url
);
vlc_UrlClean
(
&
p_sys
->
url
);
vlc_UrlClean
(
&
p_sys
->
proxy
);
if
(
p_sys
->
b_proxy
)
vlc_UrlClean
(
&
p_sys
->
proxy
);
free
(
p_sys
->
psz_proxy_passbuf
);
free
(
p_sys
->
psz_proxy_passbuf
);
free
(
p_sys
->
psz_mime
);
free
(
p_sys
->
psz_mime
);
free
(
p_sys
->
psz_pragma
);
free
(
p_sys
->
psz_pragma
);
...
@@ -539,7 +552,8 @@ static void Close( vlc_object_t *p_this )
...
@@ -539,7 +552,8 @@ static void Close( vlc_object_t *p_this )
vlc_UrlClean
(
&
p_sys
->
url
);
vlc_UrlClean
(
&
p_sys
->
url
);
http_auth_Reset
(
&
p_sys
->
auth
);
http_auth_Reset
(
&
p_sys
->
auth
);
vlc_UrlClean
(
&
p_sys
->
proxy
);
if
(
p_sys
->
b_proxy
)
vlc_UrlClean
(
&
p_sys
->
proxy
);
http_auth_Reset
(
&
p_sys
->
proxy_auth
);
http_auth_Reset
(
&
p_sys
->
proxy_auth
);
free
(
p_sys
->
psz_mime
);
free
(
p_sys
->
psz_mime
);
...
@@ -1151,7 +1165,8 @@ static int Request( access_t *p_access, uint64_t i_tell )
...
@@ -1151,7 +1165,8 @@ static int Request( access_t *p_access, uint64_t i_tell )
AuthReply
(
p_access
,
""
,
&
p_sys
->
url
,
&
p_sys
->
auth
);
AuthReply
(
p_access
,
""
,
&
p_sys
->
url
,
&
p_sys
->
auth
);
/* Proxy Authentication */
/* Proxy Authentication */
if
(
p_sys
->
proxy
.
psz_username
&&
p_sys
->
proxy
.
psz_password
)
if
(
p_sys
->
b_proxy
&&
p_sys
->
proxy
.
psz_username
!=
NULL
&&
p_sys
->
proxy
.
psz_password
!=
NULL
)
AuthReply
(
p_access
,
"Proxy-"
,
&
p_sys
->
proxy
,
&
p_sys
->
proxy_auth
);
AuthReply
(
p_access
,
"Proxy-"
,
&
p_sys
->
proxy
,
&
p_sys
->
proxy_auth
);
/* ICY meta data request */
/* ICY meta data request */
...
...
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