Advertise DAAP updates support in server-info

We don't send out DAAP updates, but Remote requires this to work.
This commit is contained in:
Kai Elwert 2010-10-09 15:54:53 +02:00 committed by Julien BLACHE
parent a8e7a7aeeb
commit ee7b976eeb

View File

@ -1161,24 +1161,17 @@ daap_reply_server_info(struct evhttp_request *req, struct evbuffer *evbuf, char
char *name; char *name;
char *passwd; char *passwd;
const char *clientver; const char *clientver;
int supports_update;
int mpro; int mpro;
int apro; int apro;
int len; int len;
int ret; int ret;
/* We don't support updates atm */
supports_update = 0;
lib = cfg_getsec(cfg, "library"); lib = cfg_getsec(cfg, "library");
passwd = cfg_getstr(lib, "password"); passwd = cfg_getstr(lib, "password");
name = cfg_getstr(lib, "name"); name = cfg_getstr(lib, "name");
len = 157 + strlen(name); len = 157 + strlen(name);
if (!supports_update)
len -= 9;
ret = evbuffer_expand(evbuf, len); ret = evbuffer_expand(evbuf, len);
if (ret < 0) if (ret < 0)
{ {
@ -1225,8 +1218,8 @@ daap_reply_server_info(struct evhttp_request *req, struct evbuffer *evbuf, char
dmap_add_char(evbuf, "mspi", 1); /* 9 */ dmap_add_char(evbuf, "mspi", 1); /* 9 */
dmap_add_int(evbuf, "msdc", 1); /* 12 */ dmap_add_int(evbuf, "msdc", 1); /* 12 */
if (supports_update) /* Advertise updates support even though we don't send updates */
dmap_add_char(evbuf, "msup", 0); /* 9 */ dmap_add_char(evbuf, "msup", 1); /* 9 */
httpd_send_reply(req, HTTP_OK, "OK", evbuf); httpd_send_reply(req, HTTP_OK, "OK", evbuf);
} }