Add 'authenticate' method.
This commit is contained in:
parent
c96c32b4f2
commit
de15de8a53
1 changed files with 16 additions and 0 deletions
16
htsp.c
16
htsp.c
|
@ -480,6 +480,21 @@ htsp_method_unsubscribe(htsp_connection_t *htsp, htsmsg_t *in)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Try to authenticate
|
||||
*/
|
||||
static htsmsg_t *
|
||||
htsp_method_authenticate(htsp_connection_t *htsp, htsmsg_t *in)
|
||||
{
|
||||
htsmsg_t *r = htsmsg_create_map();
|
||||
|
||||
if(!(htsp->htsp_granted_access & HTSP_PRIV_MASK))
|
||||
htsmsg_add_u32(r, "noaccess", 1);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update challenge
|
||||
*/
|
||||
|
@ -505,6 +520,7 @@ struct {
|
|||
htsmsg_t *(*fn)(htsp_connection_t *htsp, htsmsg_t *in);
|
||||
int privmask;
|
||||
} htsp_methods[] = {
|
||||
{ "authenticate", htsp_method_authenticate, 0},
|
||||
{ "enableAsyncMetadata", htsp_method_async, ACCESS_STREAMING},
|
||||
{ "getEvent", htsp_method_getEvent, ACCESS_STREAMING},
|
||||
{ "subscribe", htsp_method_subscribe, ACCESS_STREAMING},
|
||||
|
|
Loading…
Add table
Reference in a new issue