From 6acd73da5778a0153907075ec3884a502fe28562 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Tue, 4 Jul 2023 19:28:05 +0100 Subject: [PATCH] Make the change to short DACP polling (semi-)permanent. Maye look at this again in the future. --- dacp.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/dacp.c b/dacp.c index c7adac58..14154263 100644 --- a/dacp.c +++ b/dacp.c @@ -412,19 +412,12 @@ void set_dacp_server_information(rtsp_conn_info *conn) { dacp_server.ip_string, dacp_server.dacp_id); /* - // If the client is forked-daapd, then we always use revision number 1 - // because otherwise the return read will hang in a "long poll" if there - // are no changes. - // This is different to other AirPlay clients - // which return immediately with a 403 code if there are no changes. - dacp_server.always_use_revision_number_1 = 0; - if (conn->UserAgent != NULL) { - char *p = strstr(conn->UserAgent, "forked-daapd"); - if ((p != 0) && - (p == conn->UserAgent)) { // must exist and be at the start of the UserAgent string - dacp_server.always_use_revision_number_1 = 1; - } - } + +"long polling" is not implemented by Shairport Sync, whereby by sending the client the +last-received revision number, the link will hang until a change occurs. + +Instead, at present, Shairport Sync always uses a revision number of 1. + */ // always use revision number 1 @@ -658,7 +651,7 @@ void *dacp_monitor_thread_code(__attribute__((unused)) void *na) { char *response = NULL; int32_t item_size; char command[1024] = ""; - if (always_use_revision_number_1 != 0) // for forked-daapd + if (always_use_revision_number_1 != 0) // see the "long polling" note above revision_number = 1; snprintf(command, sizeof(command) - 1, "playstatusupdate?revision-number=%d", revision_number);