From d231faff2db7b962573d5da498296fc8a047cf76 Mon Sep 17 00:00:00 2001 From: Ace Jones Date: Sun, 20 Dec 2009 14:43:28 +0100 Subject: [PATCH] Handle DAAP activity request Reply to the DAAP /activity request with 204 / No content. Used by iTunes to ping the server while streaming. --- src/httpd_daap.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/httpd_daap.c b/src/httpd_daap.c index 113f9677..835cfe41 100644 --- a/src/httpd_daap.c +++ b/src/httpd_daap.c @@ -897,6 +897,13 @@ daap_reply_update(struct evhttp_request *req, struct evbuffer *evbuf, char **uri evhttp_send_reply(req, HTTP_OK, "OK", evbuf); } +static void +daap_reply_activity(struct evhttp_request *req, struct evbuffer *evbuf, char **uri, struct evkeyvalq *query) +{ + /* That's so nice, thanks for letting us know */ + evhttp_send_reply(req, HTTP_NOCONTENT, "No Content", evbuf); +} + static void daap_reply_dblist(struct evhttp_request *req, struct evbuffer *evbuf, char **uri, struct evkeyvalq *query) { @@ -1724,6 +1731,10 @@ static struct uri_map daap_handlers[] = .regexp = "^/update$", .handler = daap_reply_update }, + { + .regexp = "^/activity$", + .handler = daap_reply_activity + }, { .regexp = "^/databases$", .handler = daap_reply_dblist @@ -1940,6 +1951,8 @@ daap_is_request(struct evhttp_request *req, char *uri) return 1; if (strcmp(uri, "/update") == 0) return 1; + if (strcmp(uri, "/activity") == 0) + return 1; if (strcmp(uri, "/logout") == 0) return 1;