jasonmc / forked-daapd

A re-write of the firefly media server (mt-daapd). It's released under GPLv2+. Please note that this git repository is a mirror of the official one at git://git.debian.org/~jblache/forked-daapd.git
http://blog.technologeek.org/2009/06/12/217
GNU General Public License v2.0
328 stars 45 forks source link

Rhythmbox - Rejecting login #21

Open netmindz opened 13 years ago

netmindz commented 13 years ago

If i try and register forked-daapd to rhythmbox-0.12.6 then i just get a message saying connecting and the logs of daapd are full of the following

daap: No User-Agent header, rejecting login request

If this a bug with rhythmbox or forked-daapd. The same version of rhythmbox works fine with mt-daapd

netmindz commented 13 years ago

GET /login HTTP/1.1

Host: 192.168.1.2:3689

Client-DAAP-Version: 3.0

Accept-Language: en-us, en;q=5.0

Accept-Encoding: gzip

Client-DAAP-Access-Index: 2

HTTP/1.1 403 Forbidden

Content-Type: text/html

Connection: close

Date: Wed, 20 Oct 2010 11:16:06 GMT

Content-Length: 132

403 Forbidden

Method Not Implemented

Invalid method in request

netmindz commented 13 years ago

The following patch works round the bug

netmindz commented 13 years ago
--- ./src/httpd_daap.c.old  2010-10-20 12:24:33.610022567 +0100
+++ ./src/httpd_daap.c  2010-10-20 12:25:37.847272532 +0100
@@ -1292,10 +1292,8 @@
   ua = evhttp_find_header(req->input_headers, "User-Agent");
   if (!ua)
     {
-      DPRINTF(E_LOG, L_DAAP, "No User-Agent header, rejecting login request\n");
-
-      evhttp_send_error(req, 403, "Forbidden");
-      return;
+      DPRINTF(E_LOG, L_DAAP, "No User-Agent header, setting to Unknown");
+      ua = "Unknown";
     }

   if (strncmp(ua, "Remote", strlen("Remote")) == 0)
Fabioamd87 commented 12 years ago

I have this bug with ubuntu 11.10 (both client and server)

Halfwalker commented 12 years ago

Also with Rhythmbox on an old Karmic system talking to forked-daapd v0.19 on an ubuntu 11.10 server.

Any chance of the patch making it into the stock package ? Rebuilding from source with all the dev libs is getting to be a pain :)