Commit Graph

116 Commits

Author SHA1 Message Date
ejurgensen 10e4a138a3 Fix crash after special (malformed?) TunesRemote SE daap request
Request has comma before &query:
/databases/1/containers/1/items?session-id=100&meta=dmap.itemname,[...],daap.songcompilation,&query=('com.apple...
2013-12-02 20:55:16 +01:00
ejurgensen d85eb171cb Lower log level to spam for metadata message in httpd_daap.c 2013-11-16 22:52:53 +01:00
ejurgensen 7bb2fef25f Lower log level to spam for DMAP investigation and add dmap_add_raw_uint32() for later use 2013-11-14 23:08:20 +01:00
ejurgensen 28b485c595 Fix malformed DAAP packages 2013-11-10 12:35:24 +01:00
ejurgensen 9b190fe282 Fix group-type-type 2013-08-29 22:43:59 +02:00
ejurgensen 95fc525beb Add support for artist group request (experimental)
The purpose of this is mainly to support Hyperfine Remote for Android
2013-08-29 22:00:37 +02:00
Craig Markwardt c2e6eeda32 Fixes for Amarok and Banshee clients which don't send
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.
2012-01-02 04:22:39 -05:00
Craig Markwardt bd10978d52 Fixes for iTunes v10.5 time-outs.
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.
2012-01-02 02:15:18 -05:00
Julien BLACHE 4be0d86aa0 Revert "Disable session expiration"
This reverts commit c70caad87e.
2011-09-10 18:44:37 +02:00
Julien BLACHE 9f06848d43 Reply to update requests periodically to avoid 30-minute iTunes timeout
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.
2011-09-10 18:37:16 +02:00
Julien BLACHE a70a45d925 Fix DAAP songlist generation after code move to dmap_common
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.
2011-04-28 18:25:14 +02:00
Julien BLACHE 718d1e9487 Migrate file metadata encoding to DMAP common code 2011-04-09 10:11:35 +02:00
Julien BLACHE 07df6bb4aa Move dmap_add_field() to DMAP common code 2011-04-09 10:11:35 +02:00
Julien BLACHE 39542aee27 Move DMAP fields list and hash table to DMAP common code 2011-04-09 10:11:34 +02:00
Julien BLACHE 52691d6c4d Rename dmap_helpers.[ch] to dmap_common.[ch] 2011-04-09 10:11:34 +02:00
Julien BLACHE e23f02c7c0 Replace AVL tree in DAAP by a static hash using gperf 2011-04-02 09:52:19 +02:00
Julien BLACHE 303a3329eb Replace AVL tree in DAAP query by a static hash using gperf 2011-04-02 09:52:19 +02:00
Julien BLACHE 204c9681ca Enable and handle JPEG artwork in DAAP 2011-04-01 22:02:51 +02:00
Julien BLACHE c7209ab699 Add support for JPEG as a valid artwork output format
Reduce CPU usage by avoiding unneeded JPEG -> PNG conversions; it appears
all the clients we care about support JPEG as well as PNG.
2011-03-30 21:50:29 +02:00
Julien BLACHE f5b167080b Use title_sort for DAAP sort headers 2011-03-21 18:48:00 +01:00
Kai Elwert 4dce6390ea Switch to using db_query_fetch_string_sort() in daap_reply_browse() 2011-03-21 18:48:00 +01:00
Kai Elwert bf86cf45bd Always include sort tags in songlist 2011-03-21 18:47:59 +01:00
Julien BLACHE c70caad87e Disable session expiration
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.
2010-11-11 10:44:57 +01:00
Kai Elwert e5af78fe9f Implement sort=artist for DAAP queries 2010-10-09 16:06:00 +02:00
Kai Elwert ee7b976eeb Advertise DAAP updates support in server-info
We don't send out DAAP updates, but Remote requires this to work.
2010-10-09 15:54:53 +02:00
Julien BLACHE f7c2bf756a Remove duplicate mstm tag in server-info reply 2010-09-18 22:50:26 +02:00
Julien BLACHE 535d691a4a Fix full_uri memory leak in error path 2010-09-10 18:47:42 +02:00
Kai Elwert de8884c8df Add sort-headers support to DAAP song lists 2010-09-04 10:58:25 +02:00
Kai Elwert ee294753e1 Add sort-headers support to DAAP groups query 2010-08-29 12:07:08 +02:00
Kai Elwert 8a2d76895c Add sort-headers support to DAAP browse query 2010-08-29 12:07:08 +02:00
Kai Elwert eaaaec91a1 Introduce DAAP sort-headers helpers 2010-08-29 12:07:07 +02:00
Kai Elwert d4f341aff0 Handle include-sort-headers parameter in DAAP queries 2010-08-29 12:07:07 +02:00
Julien BLACHE 471f750a8c Rework error handling where an oom variable was used
The oom-specific message was actually never used as it was hidden by
ret being < 0 and that condition was tested before oom.
2010-08-29 12:05:02 +02:00
Julien BLACHE 1d35afbe62 Fixup file modes 2010-08-06 17:27:56 +02:00
Kai Elwert ca72ee5926 Handle sort parameter in DAAP queries
This is used by Remote for the Title view.
2010-08-05 18:28:02 +02:00
Kai Elwert 4347731133 Add mpco to playlists, hardcode to 0 for now 2010-07-31 10:40:39 +02:00
Kai Elwert 931c0aac29 Map mper to playlist id for playlists 2010-07-31 10:39:41 +02:00
Julien BLACHE 25ee24d2be Properly deinit DAAP sessions
Call event_del() before freeing the session when clearing the AVL tree. Caused
an infinite loop in event_base_free() in httpd_deinit().
2010-07-30 21:52:04 +02:00
Julien BLACHE f6a9e1f7f4 Kill update request connections during deinit
Avoid leaving active requests on the HTTP server before shutting it down.
2010-07-30 21:42:53 +02:00
Julien BLACHE 81d09ed234 Account for new evhttp behaviour on failed incoming connections
The evcon associated with a request is freed by evhttp when the connection
fails. Protect against a NULL evcon when handling the connection failure.
2010-07-23 18:28:29 +02:00
Julien BLACHE 548cd2a150 Use httpd_send_reply() instead of evhttp_send_reply() where pertinent
gzip replies where useful; artwork should not be compressed, as PNGs are
already compressed and that would be a waste of time.
2010-05-03 19:11:55 +02:00
Julien BLACHE dc95a04562 Add optional sorting clause to Q_ITEMS 2010-05-02 11:44:43 +02:00
Julien BLACHE bccc6da87f Set closecb to NULL on update requests' connections at deinit
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.
2010-05-02 11:21:07 +02:00
Julien BLACHE 17b1e1a7bf Fix size_t in snprintf() 2010-05-02 10:17:22 +02:00
Julien BLACHE 1df0258055 Demote "could not find requested meta field" message to E_WARN 2010-04-10 09:46:48 +02:00
Julien BLACHE 19b6780a3c Remove provisions for multi-library support
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.
2010-03-19 19:09:18 +01:00
Julien BLACHE ece7c0d071 Handle DAAP extra_data requests for groups/items artwork 2010-03-07 15:45:52 +01:00
Julien BLACHE 641e5462cc Rename pl_id member of struct query_params 2010-03-07 15:23:40 +01:00
Julien BLACHE 224ef48137 Make album groups persistent
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.
2010-03-06 19:02:49 +01:00
Julien BLACHE 748cca63be Maintain songalbumid inside the files table
songalbumid is used a lot in queries from Remote; computing the hash for
each row is a major waste of time on big libraries and slow machines, so
let's store the hash in the table.

This brings us to schema version 7.
2010-03-06 17:29:37 +01:00