revision-number in their update request.
Details: Banshee (v1.6.1) and Amarok client players send an
update request but do not send the revision-number parameter.
iTunes version 10 (and perhaps earlier) does send this parameter.
See: https://github.com/jasonmc/forked-daapd/issues/78
Fix: function daap_reply_update() now warns when revision-number
is not submitted by the client, but does not reply with an error.
In that case the server assumes a revision-number which insures
an update is sent back to the client.
Testing:
I verified that the following clients were able to connect succesfully
and retrieve a library listing:
* iTunes 10.5.2
* iTunes 10.4.2
* iTunes 9.7.1
* Rhythmbox 0.12.8
* Banshee 1.6.1
I can't test with Amarok since I don't have this client.
Details:
iTunes v10.5 clients changed how they responded to DAAP
protocol, and started disconnecting when the forked-daapd server
sent an empty "refresh" reply ("mupd" protocol). This problem is
also coupled with session-timeout ("mstm" and "msal"); when these
server capabilities were enabled, iTunes 10.x clients did not poll
for updates and eventually disconnected.
I investigated DAAP network packets using Wireshark. I found that
a true iTunes server sends a set of server capabilities in a specific
order, and order matters to the client. When the correct order is used,
the client correctly polls for updates and does not disconnect.
This change:
1. Send server capabilities in different order (daap_reply_server_info).
2. Disables 5-minute update refresh.
3. Disables 30-minute inactivity time-out.
Testing:
This server version successfully stayed connected to the
following clients:
* iTunes 10.5.2
* iTunes 10.4.2
* iTunes 9.7.1
* Rhythmbox 0.12.8
The clients stayed connected for at least several hours,
sometimes days, with activity or no activity.
Craig Markwardt <craig.markwardt@gmail.com> found out that the 30-minute
timeout in iTunes was caused by the lack of reply to update requests.
We now send out replies every 5 minutes, avoiding the timeout and
disconnection.
Thanks to Craig for digging into this, producing code to demonstrate the fix
and trying out a few more ideas for update support beyond this fix.
Handling of the sort tags was left into httpd_daap.c where the code runs
after the song is added to the songlist - effectively adding the sort tags
to the *next* song, leading to incorrect sort tags on the current song.
Auto-logout currently doesn't work as expected and breaks streaming etc once
the timeout occurs. Disable it until we can make it work as expected.
Maybe we'll need to upgrade the DAAP version.
Otherwise the closecb is called when the connection is closed/freed during
deinit, and this happens in the HTTP cleanup after the DAAP and DACP cleanups
have run, leading to spurious "struct update_request not found" messages.
It is now clear that multi-library support will not happen, so remove whatever
provisions were in the code for that.
It comes with a small change to the configuration file, too.
With this, DB schema version went to 9.
Store groups (only album groups supported at the moment) in the DB,
so their ids are persistent for the duration of the forked-daapd session.
Those ids are used to, among other things, retrieve artwork, so we must
provide ourselves some persistence here.
This brings us to schema version 8.