Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
af19f5c9
Commit
af19f5c9
authored
Dec 11, 2005
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Request authentication if we get a 401 error
parent
15354b04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletion
+35
-1
modules/access/http.c
modules/access/http.c
+35
-1
No files found.
modules/access/http.c
View file @
af19f5c9
...
...
@@ -31,6 +31,7 @@
#include <vlc/vlc.h>
#include <vlc/input.h>
#include "vlc_interaction.h"
#include "vlc_playlist.h"
#include "vlc_meta.h"
#include "network.h"
...
...
@@ -189,6 +190,7 @@ static int Open( vlc_object_t *p_this )
p_sys
->
psz_icy_title
=
NULL
;
p_sys
->
i_remaining
=
0
;
/* Parse URI - remove spaces */
p
=
psz
=
strdup
(
p_access
->
psz_path
);
while
(
(
p
=
strchr
(
p
,
' '
))
!=
NULL
)
...
...
@@ -266,6 +268,7 @@ static int Open( vlc_object_t *p_this )
p_sys
->
b_reconnect
=
var_CreateGetBool
(
p_access
,
"http-reconnect"
);
p_sys
->
b_continuous
=
var_CreateGetBool
(
p_access
,
"http-continuous"
);
connect:
/* Connect */
if
(
Connect
(
p_access
,
0
)
)
{
...
...
@@ -279,6 +282,31 @@ static int Open( vlc_object_t *p_this )
}
}
if
(
p_sys
->
i_code
==
401
)
{
char
*
psz_login
=
NULL
;
char
*
psz_password
=
NULL
;
int
i_ret
;
msg_Dbg
(
p_access
,
"Authentication failed"
);
i_ret
=
intf_UserLoginPassword
(
p_access
,
"HTTP authentication"
,
"Authentication failed"
,
&
psz_login
,
&
psz_password
);
if
(
i_ret
==
DIALOG_OK_YES
)
{
msg_Dbg
(
p_access
,
"retrying with user=%s, pwd=%s"
,
psz_login
,
psz_password
);
if
(
psz_login
)
p_sys
->
url
.
psz_username
=
strdup
(
psz_login
);
if
(
psz_password
)
p_sys
->
url
.
psz_password
=
strdup
(
psz_password
);
if
(
psz_login
)
free
(
psz_login
);
if
(
psz_password
)
free
(
psz_password
);
goto
connect
;
}
else
{
if
(
psz_login
)
free
(
psz_login
);
if
(
psz_password
)
free
(
psz_password
);
goto
error
;
}
}
if
(
(
p_sys
->
i_code
==
301
||
p_sys
->
i_code
==
302
||
p_sys
->
i_code
==
303
||
p_sys
->
i_code
==
307
)
&&
p_sys
->
psz_location
&&
*
p_sys
->
psz_location
)
...
...
@@ -988,7 +1016,13 @@ static int Request( access_t *p_access, int64_t i_tell )
{
p_sys
->
b_seekable
=
VLC_FALSE
;
}
if
(
p_sys
->
i_code
>=
400
)
/* Authentication error - We'll have to display the dialog */
if
(
p_sys
->
i_code
==
401
)
{
}
/* Other fatal error */
else
if
(
p_sys
->
i_code
>=
400
)
{
msg_Err
(
p_access
,
"error: %s"
,
psz
);
free
(
psz
);
...
...
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