mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-24 11:59:16 -05:00
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.
This commit is contained in:
parent
13c9de3ed1
commit
548cd2a150
@ -1041,7 +1041,7 @@ daap_reply_server_info(struct evhttp_request *req, struct evbuffer *evbuf, char
|
||||
if (supports_update)
|
||||
dmap_add_char(evbuf, "msup", 0); /* 9 */
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1080,7 +1080,7 @@ daap_reply_content_codes(struct evhttp_request *req, struct evbuffer *evbuf, cha
|
||||
dmap_add_short(evbuf, "mcty", df->type); /* 10 */
|
||||
}
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1149,7 +1149,7 @@ daap_reply_login(struct evhttp_request *req, struct evbuffer *evbuf, char **uri,
|
||||
dmap_add_int(evbuf, "mstt", 200); /* 12 */
|
||||
dmap_add_int(evbuf, "mlid", s->id); /* 12 */
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1163,7 +1163,7 @@ daap_reply_logout(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
|
||||
|
||||
daap_session_kill(s);
|
||||
|
||||
evhttp_send_reply(req, 204, "Logout Successful", evbuf);
|
||||
httpd_send_reply(req, 204, "Logout Successful", evbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1214,7 +1214,7 @@ daap_reply_update(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
|
||||
dmap_add_int(evbuf, "mstt", 200); /* 12 */
|
||||
dmap_add_int(evbuf, "musr", current_rev); /* 12 */
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1292,7 +1292,7 @@ daap_reply_dblist(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
|
||||
count = db_pl_get_count();
|
||||
dmap_add_int(evbuf, "mctc", count); /* 12 */
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1609,7 +1609,7 @@ daap_reply_songlist_generic(struct evhttp_request *req, struct evbuffer *evbuf,
|
||||
return;
|
||||
}
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
|
||||
return;
|
||||
|
||||
@ -1885,7 +1885,7 @@ daap_reply_playlists(struct evhttp_request *req, struct evbuffer *evbuf, char **
|
||||
return;
|
||||
}
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
|
||||
return;
|
||||
|
||||
@ -2109,7 +2109,7 @@ daap_reply_groups(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
|
||||
return;
|
||||
}
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
|
||||
return;
|
||||
|
||||
@ -2254,7 +2254,7 @@ daap_reply_browse(struct evhttp_request *req, struct evbuffer *evbuf, char **uri
|
||||
return;
|
||||
}
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
}
|
||||
|
||||
/* NOTE: We only handle artwork at the moment */
|
||||
@ -2334,6 +2334,7 @@ daap_reply_extra_data(struct evhttp_request *req, struct evbuffer *evbuf, char *
|
||||
snprintf(clen, sizeof(clen), "%ld", (long)EVBUFFER_LENGTH(evbuf));
|
||||
evhttp_add_header(req->output_headers, "Content-Length", clen);
|
||||
|
||||
/* No gzip compression for artwork */
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
return;
|
||||
|
||||
|
@ -321,7 +321,7 @@ playstatusupdate_cb(int fd, short what, void *arg)
|
||||
|
||||
evbuffer_add(evbuf, EVBUFFER_DATA(update), EVBUFFER_LENGTH(update));
|
||||
|
||||
evhttp_send_reply(ur->req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(ur->req, HTTP_OK, "OK", evbuf);
|
||||
|
||||
free(ur);
|
||||
}
|
||||
@ -631,7 +631,7 @@ dacp_reply_ctrlint(struct evhttp_request *req, struct evbuffer *evbuf, char **ur
|
||||
dmap_add_char(evbuf, "casu", 1); /* 9 */
|
||||
dmap_add_char(evbuf, "ceSG", 1); /* 9 */
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -697,7 +697,7 @@ dacp_reply_cue_play(struct evhttp_request *req, struct evbuffer *evbuf, char **u
|
||||
dmap_add_int(evbuf, "mstt", 200); /* 12 */
|
||||
dmap_add_int(evbuf, "miid", id); /* 12 */
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -713,7 +713,7 @@ dacp_reply_cue_clear(struct evhttp_request *req, struct evbuffer *evbuf, char **
|
||||
dmap_add_int(evbuf, "mstt", 200); /* 12 */
|
||||
dmap_add_int(evbuf, "miid", 0); /* 12 */
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -932,7 +932,7 @@ dacp_reply_playstatusupdate(struct evhttp_request *req, struct evbuffer *evbuf,
|
||||
if (ret < 0)
|
||||
evhttp_send_error(req, 500, "Internal Server Error");
|
||||
else
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1027,6 +1027,7 @@ dacp_reply_nowplayingartwork(struct evhttp_request *req, struct evbuffer *evbuf,
|
||||
snprintf(clen, sizeof(clen), "%ld", (long)EVBUFFER_LENGTH(evbuf));
|
||||
evhttp_add_header(req->output_headers, "Content-Length", clen);
|
||||
|
||||
/* No gzip compression for artwork */
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
return;
|
||||
|
||||
@ -1128,7 +1129,7 @@ dacp_reply_getproperty(struct evhttp_request *req, struct evbuffer *evbuf, char
|
||||
return;
|
||||
}
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
|
||||
return;
|
||||
|
||||
@ -1235,7 +1236,7 @@ dacp_reply_getspeakers(struct evhttp_request *req, struct evbuffer *evbuf, char
|
||||
|
||||
evbuffer_free(spklist);
|
||||
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -328,7 +328,7 @@ rsp_reply_info(struct evhttp_request *req, char **uri, struct evkeyvalq *query)
|
||||
|
||||
evhttp_add_header(req->output_headers, "Content-Type", "text/xml; charset=utf-8");
|
||||
evhttp_add_header(req->output_headers, "Connection", "close");
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
|
||||
evbuffer_free(evbuf);
|
||||
}
|
||||
@ -434,7 +434,7 @@ rsp_reply_db(struct evhttp_request *req, char **uri, struct evkeyvalq *query)
|
||||
|
||||
evhttp_add_header(req->output_headers, "Content-Type", "text/xml; charset=utf-8");
|
||||
evhttp_add_header(req->output_headers, "Connection", "close");
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
|
||||
evbuffer_free(evbuf);
|
||||
}
|
||||
@ -629,7 +629,7 @@ rsp_reply_playlist(struct evhttp_request *req, char **uri, struct evkeyvalq *que
|
||||
|
||||
evhttp_add_header(req->output_headers, "Content-Type", "text/xml; charset=utf-8");
|
||||
evhttp_add_header(req->output_headers, "Connection", "close");
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
|
||||
evbuffer_free(evbuf);
|
||||
}
|
||||
@ -759,7 +759,7 @@ rsp_reply_browse(struct evhttp_request *req, char **uri, struct evkeyvalq *query
|
||||
|
||||
evhttp_add_header(req->output_headers, "Content-Type", "text/xml; charset=utf-8");
|
||||
evhttp_add_header(req->output_headers, "Connection", "close");
|
||||
evhttp_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
httpd_send_reply(req, HTTP_OK, "OK", evbuf);
|
||||
|
||||
evbuffer_free(evbuf);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user