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
7da227d4
Commit
7da227d4
authored
Feb 02, 2016
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: rename http_auth to vlc_http_auth
parent
a41e0571
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
57 deletions
+57
-57
include/vlc_http.h
include/vlc_http.h
+10
-11
modules/access/http.c
modules/access/http.c
+24
-23
modules/stream_out/raop.c
modules/stream_out/raop.c
+7
-7
src/Makefile.am
src/Makefile.am
+1
-1
src/check_symbols
src/check_symbols
+1
-1
src/libvlccore.sym
src/libvlccore.sym
+5
-5
src/network/http_auth.c
src/network/http_auth.c
+9
-9
No files found.
include/vlc_http.h
View file @
7da227d4
...
...
@@ -37,7 +37,7 @@
#include <vlc_arrays.h>
/* RFC 2617: Basic and Digest Access Authentication */
typedef
struct
http_auth_t
typedef
struct
vlc_
http_auth_t
{
char
*
psz_realm
;
char
*
psz_domain
;
...
...
@@ -49,21 +49,20 @@ typedef struct http_auth_t
int
i_nonce
;
char
*
psz_cnonce
;
char
*
psz_HA1
;
/* stored H(A1) value if algorithm = "MD5-sess" */
}
http_auth_t
;
}
vlc_
http_auth_t
;
VLC_API
void
http_auth_Init
(
http_auth_t
*
);
VLC_API
void
http_auth_Reset
(
http_auth_t
*
);
VLC_API
void
http_auth_ParseWwwAuthenticateHeader
(
vlc_object_t
*
,
http_auth_t
*
,
const
char
*
);
VLC_API
int
http_auth_ParseAuthenticationInfoHeader
(
vlc_object_t
*
,
http_auth_t
*
,
VLC_API
void
vlc_http_auth_Init
(
vlc_http_auth_t
*
);
VLC_API
void
vlc_http_auth_Reset
(
vlc_http_auth_t
*
);
VLC_API
void
vlc_http_auth_ParseWwwAuthenticateHeader
(
vlc_object_t
*
,
vlc_http_auth_t
*
,
const
char
*
);
VLC_API
int
vlc_http_auth_ParseAuthenticationInfoHeader
(
vlc_object_t
*
,
vlc_http_auth_t
*
,
const
char
*
,
const
char
*
,
const
char
*
,
const
char
*
,
const
char
*
);
VLC_API
char
*
http_auth_FormatAuthorizationHeader
(
vlc_object_t
*
,
http_auth_t
*
,
VLC_API
char
*
vlc_
http_auth_FormatAuthorizationHeader
(
vlc_object_t
*
,
vlc_
http_auth_t
*
,
const
char
*
,
const
char
*
,
const
char
*
,
const
char
*
)
VLC_USED
;
...
...
modules/access/http.c
View file @
7da227d4
...
...
@@ -134,12 +134,12 @@ struct access_sys_t
char
*
psz_referrer
;
char
*
psz_username
;
char
*
psz_password
;
http_auth_t
auth
;
vlc_
http_auth_t
auth
;
/* Proxy */
bool
b_proxy
;
vlc_url_t
proxy
;
http_auth_t
proxy_auth
;
vlc_
http_auth_t
proxy_auth
;
char
*
psz_proxy_passbuf
;
/* */
...
...
@@ -185,9 +185,9 @@ static void Disconnect( access_t * );
static
void
AuthReply
(
access_t
*
p_acces
,
const
char
*
psz_prefix
,
vlc_url_t
*
p_url
,
http_auth_t
*
p_auth
);
vlc_url_t
*
p_url
,
vlc_
http_auth_t
*
p_auth
);
static
int
AuthCheckReply
(
access_t
*
p_access
,
const
char
*
psz_header
,
vlc_url_t
*
p_url
,
http_auth_t
*
p_auth
);
vlc_url_t
*
p_url
,
vlc_
http_auth_t
*
p_auth
);
static
vlc_http_cookie_jar_t
*
GetCookieJar
(
vlc_object_t
*
p_this
);
/*****************************************************************************
...
...
@@ -237,8 +237,8 @@ static int Open( vlc_object_t *p_this )
else
p_sys
->
cookies
=
NULL
;
http_auth_Init
(
&
p_sys
->
auth
);
http_auth_Init
(
&
p_sys
->
proxy_auth
);
vlc_
http_auth_Init
(
&
p_sys
->
auth
);
vlc_
http_auth_Init
(
&
p_sys
->
proxy_auth
);
vlc_UrlParse
(
&
p_sys
->
url
,
psz_url
);
vlc_credential_init
(
&
credential
,
&
p_sys
->
url
);
...
...
@@ -470,10 +470,10 @@ static void Close( vlc_object_t *p_this )
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
vlc_UrlClean
(
&
p_sys
->
url
);
http_auth_Reset
(
&
p_sys
->
auth
);
vlc_
http_auth_Reset
(
&
p_sys
->
auth
);
if
(
p_sys
->
b_proxy
)
vlc_UrlClean
(
&
p_sys
->
proxy
);
http_auth_Reset
(
&
p_sys
->
proxy_auth
);
vlc_
http_auth_Reset
(
&
p_sys
->
proxy_auth
);
free
(
p_sys
->
psz_mime
);
free
(
p_sys
->
psz_location
);
...
...
@@ -1276,14 +1276,14 @@ static int Request( access_t *p_access, uint64_t i_tell )
else
if
(
!
strcasecmp
(
psz
,
"www-authenticate"
)
)
{
msg_Dbg
(
p_access
,
"Authentication header: %s"
,
p
);
http_auth_ParseWwwAuthenticateHeader
(
VLC_OBJECT
(
p_access
),
&
p_sys
->
auth
,
p
);
vlc_
http_auth_ParseWwwAuthenticateHeader
(
VLC_OBJECT
(
p_access
),
&
p_sys
->
auth
,
p
);
}
else
if
(
!
strcasecmp
(
psz
,
"proxy-authenticate"
)
)
{
msg_Dbg
(
p_access
,
"Proxy authentication header: %s"
,
p
);
http_auth_ParseWwwAuthenticateHeader
(
VLC_OBJECT
(
p_access
),
&
p_sys
->
proxy_auth
,
p
);
vlc_
http_auth_ParseWwwAuthenticateHeader
(
VLC_OBJECT
(
p_access
),
&
p_sys
->
proxy_auth
,
p
);
}
else
if
(
!
strcasecmp
(
psz
,
"authentication-info"
)
)
{
...
...
@@ -1332,15 +1332,15 @@ static void Disconnect( access_t *p_access )
*****************************************************************************/
static
void
AuthReply
(
access_t
*
p_access
,
const
char
*
psz_prefix
,
vlc_url_t
*
p_url
,
http_auth_t
*
p_auth
)
vlc_url_t
*
p_url
,
vlc_
http_auth_t
*
p_auth
)
{
char
*
psz_value
;
psz_value
=
http_auth_FormatAuthorizationHeader
(
VLC_OBJECT
(
p_access
),
p_auth
,
"GET"
,
p_url
->
psz_path
,
p_url
->
psz_username
,
p_url
->
psz_password
);
vlc_
http_auth_FormatAuthorizationHeader
(
VLC_OBJECT
(
p_access
),
p_auth
,
"GET"
,
p_url
->
psz_path
,
p_url
->
psz_username
,
p_url
->
psz_password
);
if
(
psz_value
==
NULL
)
return
;
...
...
@@ -1349,14 +1349,15 @@ static void AuthReply( access_t *p_access, const char *psz_prefix,
}
static
int
AuthCheckReply
(
access_t
*
p_access
,
const
char
*
psz_header
,
vlc_url_t
*
p_url
,
http_auth_t
*
p_auth
)
vlc_url_t
*
p_url
,
vlc_
http_auth_t
*
p_auth
)
{
return
http_auth_ParseAuthenticationInfoHeader
(
VLC_OBJECT
(
p_access
),
p_auth
,
psz_header
,
""
,
p_url
->
psz_path
,
p_url
->
psz_username
,
p_url
->
psz_password
);
vlc_http_auth_ParseAuthenticationInfoHeader
(
VLC_OBJECT
(
p_access
),
p_auth
,
psz_header
,
""
,
p_url
->
psz_path
,
p_url
->
psz_username
,
p_url
->
psz_password
);
}
/*****************************************************************************
...
...
modules/stream_out/raop.c
View file @
7da227d4
...
...
@@ -126,7 +126,7 @@ struct sout_stream_sys_t
int
i_audio_latency
;
int
i_jack_type
;
http_auth_t
auth
;
vlc_
http_auth_t
auth
;
/* Send buffer */
size_t
i_sendbuf_len
;
...
...
@@ -838,7 +838,7 @@ static int ParseAuthenticateHeader( vlc_object_t *p_this,
goto
error
;
}
http_auth_ParseWwwAuthenticateHeader
(
p_this
,
&
p_sys
->
auth
,
psz_auth
);
vlc_
http_auth_ParseWwwAuthenticateHeader
(
p_this
,
&
p_sys
->
auth
,
psz_auth
);
error:
return
i_err
;
...
...
@@ -873,10 +873,10 @@ static int ExecRequest( vlc_object_t *p_this, const char *psz_method,
FREENULL
(
psz_authorization
);
psz_authorization
=
http_auth_FormatAuthorizationHeader
(
p_this
,
&
p_sys
->
auth
,
psz_method
,
p_sys
->
psz_url
,
""
,
p_sys
->
psz_password
);
vlc_
http_auth_FormatAuthorizationHeader
(
p_this
,
&
p_sys
->
auth
,
psz_method
,
p_sys
->
psz_url
,
""
,
p_sys
->
psz_password
);
if
(
psz_authorization
==
NULL
)
{
i_err
=
VLC_EGENERIC
;
...
...
@@ -1397,7 +1397,7 @@ static int Open( vlc_object_t *p_this )
p_sys
->
i_volume
=
var_GetInteger
(
p_stream
,
SOUT_CFG_PREFIX
"volume"
);
p_sys
->
i_jack_type
=
JACK_TYPE_NONE
;
http_auth_Init
(
&
p_sys
->
auth
);
vlc_
http_auth_Init
(
&
p_sys
->
auth
);
p_sys
->
psz_host
=
var_GetNonEmptyString
(
p_stream
,
SOUT_CFG_PREFIX
"host"
);
...
...
src/Makefile.am
View file @
7da227d4
...
...
@@ -416,6 +416,7 @@ SOURCES_libvlc_common = \
audio_output/output.c
\
audio_output/volume.c
\
network/getaddrinfo.c
\
network/http_auth.c
\
network/io.c
\
network/tcp.c
\
network/udp.c
\
...
...
@@ -481,7 +482,6 @@ SOURCES_libvlc_common = \
misc/addons.c
\
misc/filter.c
\
misc/filter_chain.c
\
misc/http_auth.c
\
misc/httpcookies.c
\
misc/fingerprinter.c
\
misc/text_style.c
\
...
...
src/check_symbols
View file @
7da227d4
...
...
@@ -17,7 +17,7 @@ cat libvlccore.sym | grep -v \
-e
'^playlist_'
-e
'^services_discovery_'
-e
'^intf_'
\
-e
'^dialog_'
-e
'^update_'
-e
'^addons\?_'
-e
'^fingerprinter_'
\
-e
'^text_style_'
-e
'^text_segment_'
\
-e
'^net_'
-e
'^httpd_'
-e
'^http_auth_'
\
-e
'^net_'
-e
'^httpd_'
\
-e
'^config_'
-e
'^module_'
-e
'^var_'
\
-e
'^date_'
-e
'^sdp_'
-e
'^plane_'
\
-e
'^us_'
-e
'^utf8_'
-e
'^xml_'
-e
'^str_format_'
-e
'^GetLang_'
\
...
...
src/libvlccore.sym
View file @
7da227d4
...
...
@@ -134,11 +134,11 @@ FromCharset
GetLang_1
GetLang_2B
GetLang_2T
http_auth_Init
http_auth_Reset
http_auth_ParseWwwAuthenticateHeader
http_auth_ParseAuthenticationInfoHeader
http_auth_FormatAuthorizationHeader
vlc_
http_auth_Init
vlc_
http_auth_Reset
vlc_
http_auth_ParseWwwAuthenticateHeader
vlc_
http_auth_ParseAuthenticationInfoHeader
vlc_
http_auth_FormatAuthorizationHeader
vlc_http_cookies_new
vlc_http_cookies_destroy
vlc_http_cookies_store
...
...
src/
misc
/http_auth.c
→
src/
network
/http_auth.c
View file @
7da227d4
...
...
@@ -99,7 +99,7 @@ static char *GenerateCnonce()
return
psz_md5_hash
(
&
md5
);
}
static
char
*
AuthDigest
(
vlc_object_t
*
p_this
,
http_auth_t
*
p_auth
,
static
char
*
AuthDigest
(
vlc_object_t
*
p_this
,
vlc_
http_auth_t
*
p_auth
,
const
char
*
psz_method
,
const
char
*
psz_path
,
const
char
*
psz_username
,
const
char
*
psz_password
)
{
...
...
@@ -228,8 +228,8 @@ error:
* acceptable Authorization header is not sent, the server responds with a "401
* Unauthorized" status code, and a WWW-Authenticate header [...]
*/
void
http_auth_ParseWwwAuthenticateHeader
(
vlc_object_t
*
p_this
,
http_auth_t
*
p_auth
,
void
vlc_
http_auth_ParseWwwAuthenticateHeader
(
vlc_object_t
*
p_this
,
vlc_
http_auth_t
*
p_auth
,
const
char
*
psz_header
)
{
static
const
char
psz_basic_prefix
[]
=
"Basic "
;
...
...
@@ -306,8 +306,8 @@ void http_auth_ParseWwwAuthenticateHeader(
* The Authentication-Info header is used by the server to communicate some
* information regarding the successful authentication in the response.
*/
int
http_auth_ParseAuthenticationInfoHeader
(
vlc_object_t
*
p_this
,
http_auth_t
*
p_auth
,
int
vlc_
http_auth_ParseAuthenticationInfoHeader
(
vlc_object_t
*
p_this
,
vlc_
http_auth_t
*
p_auth
,
const
char
*
psz_header
,
const
char
*
psz_method
,
const
char
*
psz_path
,
const
char
*
psz_username
,
const
char
*
psz_password
)
{
...
...
@@ -385,8 +385,8 @@ error:
return
i_err
;
}
char
*
http_auth_FormatAuthorizationHeader
(
vlc_object_t
*
p_this
,
http_auth_t
*
p_auth
,
char
*
vlc_
http_auth_FormatAuthorizationHeader
(
vlc_object_t
*
p_this
,
vlc_
http_auth_t
*
p_auth
,
const
char
*
psz_method
,
const
char
*
psz_path
,
const
char
*
psz_username
,
const
char
*
psz_password
)
{
...
...
@@ -486,12 +486,12 @@ error:
return
psz_result
;
}
void
http_auth_Init
(
http_auth_t
*
p_auth
)
void
vlc_http_auth_Init
(
vlc_
http_auth_t
*
p_auth
)
{
memset
(
p_auth
,
0
,
sizeof
(
*
p_auth
)
);
}
void
http_auth_Reset
(
http_auth_t
*
p_auth
)
void
vlc_http_auth_Reset
(
vlc_
http_auth_t
*
p_auth
)
{
p_auth
->
i_nonce
=
0
;
...
...
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