mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-10 05:59:45 -05:00
Adjust daapcache so it serves User-Agent to httpd_daap's reply handlers
This commit is contained in:
10
src/httpd.c
10
src/httpd.c
@@ -357,6 +357,8 @@ httpd_stream_file(struct evhttp_request *req, int id)
|
||||
struct evkeyvalq *output_headers;
|
||||
const char *param;
|
||||
const char *param_end;
|
||||
const char *ua;
|
||||
const char *client_codecs;
|
||||
char buf[64];
|
||||
int64_t offset;
|
||||
int64_t end_offset;
|
||||
@@ -431,7 +433,10 @@ httpd_stream_file(struct evhttp_request *req, int id)
|
||||
memset(st, 0, sizeof(struct stream_ctx));
|
||||
st->fd = -1;
|
||||
|
||||
transcode = transcode_needed(input_headers, mfi->codectype);
|
||||
ua = evhttp_find_header(input_headers, "User-Agent");
|
||||
client_codecs = evhttp_find_header(input_headers, "Accept-Codecs");
|
||||
|
||||
transcode = transcode_needed(ua, client_codecs, mfi->codectype);
|
||||
|
||||
output_headers = evhttp_request_get_output_headers(req);
|
||||
|
||||
@@ -665,6 +670,9 @@ httpd_send_reply(struct evhttp_request *req, int code, const char *reason, struc
|
||||
int zret;
|
||||
int ret;
|
||||
|
||||
if (!req)
|
||||
return;
|
||||
|
||||
if (!evbuf || (EVBUFFER_LENGTH(evbuf) == 0))
|
||||
{
|
||||
DPRINTF(E_DBG, L_HTTPD, "Not gzipping body-less reply\n");
|
||||
|
||||
Reference in New Issue
Block a user