Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
f0cf58a8
Commit
f0cf58a8
authored
Aug 07, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix HTTP authentication.
Yes, some sites use empty usernames
parent
db9ec109
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
modules/access/http.c
modules/access/http.c
+22
-18
No files found.
modules/access/http.c
View file @
f0cf58a8
...
...
@@ -932,37 +932,41 @@ static int Request( access_t *p_access, int64_t i_tell )
}
/* Authentication */
if
(
p_sys
->
url
.
psz_username
&&
*
p_sys
->
url
.
psz_username
)
if
(
p_sys
->
url
.
psz_username
||
p_sys
->
url
.
psz_password
)
{
char
*
buf
;
char
buf
[
strlen
(
p_sys
->
url
.
psz_username
?:
""
)
+
strlen
(
p_sys
->
url
.
psz_password
?:
""
)
+
2
];
char
*
b64
;
asprintf
(
&
buf
,
"%s:%s"
,
p_sys
->
url
.
psz_username
,
p_sys
->
url
.
psz_password
?
p_sys
->
url
.
psz_password
:
""
);
snprintf
(
buf
,
sizeof
(
buf
),
"%s:%s"
,
p_sys
->
url
.
psz_username
?:
""
,
p_sys
->
url
.
psz_password
?:
""
);
b64
=
vlc_b64_encode
(
buf
);
free
(
buf
);
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
pvs
,
"Authorization: Basic %s
\r\n
"
,
b64
);
free
(
b64
);
if
(
b64
!=
NULL
)
{
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
pvs
,
"Authorization: Basic %s
\r\n
"
,
b64
);
free
(
b64
);
}
}
/* Proxy Authentication */
if
(
p_sys
->
proxy
.
psz_username
&&
*
p_sys
->
proxy
.
psz_username
)
if
(
p_sys
->
proxy
.
psz_username
||
p_sys
->
proxy
.
psz_password
)
{
char
*
buf
;
char
buf
[
strlen
(
p_sys
->
proxy
.
psz_username
?:
""
)
+
strlen
(
p_sys
->
proxy
.
psz_password
?:
""
)];
char
*
b64
;
asprintf
(
&
buf
,
"%s:%s"
,
p_sys
->
proxy
.
psz_username
,
p_sys
->
proxy
.
psz_password
?
p_sys
->
proxy
.
psz_password
:
""
);
snprintf
(
buf
,
sizeof
(
buf
),
"%s:%s"
,
p_sys
->
proxy
.
psz_username
?:
""
,
p_sys
->
proxy
.
psz_password
?:
""
);
b64
=
vlc_b64_encode
(
buf
);
free
(
buf
);
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
pvs
,
"Proxy-Authorization: Basic %s
\r\n
"
,
b64
);
free
(
b64
);
if
(
b64
!=
NULL
)
{
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
pvs
,
"Proxy-Authorization: Basic %s
\r\n
"
,
b64
);
free
(
b64
);
}
}
/* 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