From 7bb2fef25fb2b8a28639cea00c695d86a8f5cea8 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Thu, 14 Nov 2013 23:08:20 +0100 Subject: [PATCH] Lower log level to spam for DMAP investigation and add dmap_add_raw_uint32() for later use --- src/dmap_common.c | 18 ++++++++++++++++-- src/dmap_common.h | 3 +++ src/httpd_daap.c | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/dmap_common.c b/src/dmap_common.c index 7dfc7db2..421b74cb 100644 --- a/src/dmap_common.c +++ b/src/dmap_common.c @@ -167,6 +167,20 @@ dmap_add_literal(struct evbuffer *evbuf, char *tag, char *str, int len) evbuffer_add(evbuf, str, len); } +void +dmap_add_raw_uint32(struct evbuffer *evbuf, uint32_t val) +{ + unsigned char buf[4]; + + /* Value */ + buf[0] = (val >> 24) & 0xff; + buf[1] = (val >> 16) & 0xff; + buf[2] = (val >> 8) & 0xff; + buf[3] = val & 0xff; + + evbuffer_add(evbuf, buf, sizeof(buf)); +} + void dmap_add_string(struct evbuffer *evbuf, char *tag, const char *str) { @@ -427,7 +441,7 @@ dmap_encode_file_metadata(struct evbuffer *songlist, struct evbuffer *song, stru continue; } - DPRINTF(E_DBG, L_DAAP, "Investigating %s\n", df->desc); + DPRINTF(E_SPAM, L_DAAP, "Investigating %s\n", df->desc); strval = (char **) ((char *)dbmfi + dfm->mfi_offset); @@ -476,7 +490,7 @@ dmap_encode_file_metadata(struct evbuffer *songlist, struct evbuffer *song, stru dmap_add_field(song, df, *strval, val); - DPRINTF(E_DBG, L_DAAP, "Done with meta tag %s (%s)\n", df->desc, *strval); + DPRINTF(E_SPAM, L_DAAP, "Done with meta tag %s (%s)\n", df->desc, *strval); } if (sort_tags) diff --git a/src/dmap_common.h b/src/dmap_common.h index 67ab2649..fd936b52 100644 --- a/src/dmap_common.h +++ b/src/dmap_common.h @@ -67,6 +67,9 @@ dmap_add_char(struct evbuffer *evbuf, char *tag, char val); void dmap_add_literal(struct evbuffer *evbuf, char *tag, char *str, int len); +void +dmap_add_raw_uint32(struct evbuffer *evbuf, uint32_t val); + void dmap_add_string(struct evbuffer *evbuf, char *tag, const char *str); diff --git a/src/httpd_daap.c b/src/httpd_daap.c index 07bed0cf..85b55990 100644 --- a/src/httpd_daap.c +++ b/src/httpd_daap.c @@ -1407,7 +1407,7 @@ daap_reply_playlists(struct evhttp_request *req, struct evbuffer *evbuf, char ** dmap_add_field(playlist, df, *strval, 0); - DPRINTF(E_DBG, L_DAAP, "Done with meta tag %s (%s)\n", df->desc, *strval); + DPRINTF(E_SPAM, L_DAAP, "Done with meta tag %s (%s)\n", df->desc, *strval); } /* Item count (mimc) */