Fix authentication when using VLC
This commit is contained in:
parent
4ea99d9e7a
commit
a1ade3232a
2 changed files with 17 additions and 3 deletions
5
http.h
5
http.h
|
@ -108,6 +108,11 @@ typedef struct http_connection {
|
|||
|
||||
struct rtsp_session_head hc_rtsp_sessions;
|
||||
|
||||
int hc_authenticated; /* Used by RTSP, it seems VLC does not
|
||||
send authentication headers for each
|
||||
command, so we just say that it's ok
|
||||
if it has authenticated at least once */
|
||||
|
||||
struct config_head *hc_user_config;
|
||||
|
||||
/* Support for HTTP POST */
|
||||
|
|
15
rtsp.c
15
rtsp.c
|
@ -569,9 +569,18 @@ rtsp_cmd_teardown(http_connection_t *hc)
|
|||
static int
|
||||
rtsp_access_list(http_connection_t *hc)
|
||||
{
|
||||
return access_verify(hc->hc_username, hc->hc_password,
|
||||
(struct sockaddr *)&hc->hc_tcp_session.tcp_peer_addr,
|
||||
ACCESS_STREAMING);
|
||||
int x;
|
||||
|
||||
if(hc->hc_authenticated)
|
||||
return 0;
|
||||
|
||||
x = access_verify(hc->hc_username, hc->hc_password,
|
||||
(struct sockaddr *)&hc->hc_tcp_session.tcp_peer_addr,
|
||||
ACCESS_STREAMING);
|
||||
if(x == 0)
|
||||
hc->hc_authenticated = 1;
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue