From de15de8a53a323b1099173709b69d866ca5f23d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Tue, 3 Mar 2009 22:14:38 +0000 Subject: [PATCH] Add 'authenticate' method. --- htsp.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/htsp.c b/htsp.c index 82e91e17..64108057 100644 --- a/htsp.c +++ b/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},