mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-25 22:55:56 -05:00
Allow const char tags and handle null requests in dmap_common
This commit is contained in:
parent
39b9c4fc33
commit
7623de1ac4
@ -43,7 +43,7 @@ dmap_get_fields_table(int *nfields)
|
||||
|
||||
|
||||
void
|
||||
dmap_add_container(struct evbuffer *evbuf, char *tag, int len)
|
||||
dmap_add_container(struct evbuffer *evbuf, const char *tag, int len)
|
||||
{
|
||||
unsigned char buf[4];
|
||||
|
||||
@ -59,7 +59,7 @@ dmap_add_container(struct evbuffer *evbuf, char *tag, int len)
|
||||
}
|
||||
|
||||
void
|
||||
dmap_add_long(struct evbuffer *evbuf, char *tag, int64_t val)
|
||||
dmap_add_long(struct evbuffer *evbuf, const char *tag, int64_t val)
|
||||
{
|
||||
unsigned char buf[12];
|
||||
|
||||
@ -85,7 +85,7 @@ dmap_add_long(struct evbuffer *evbuf, char *tag, int64_t val)
|
||||
}
|
||||
|
||||
void
|
||||
dmap_add_int(struct evbuffer *evbuf, char *tag, int val)
|
||||
dmap_add_int(struct evbuffer *evbuf, const char *tag, int val)
|
||||
{
|
||||
unsigned char buf[8];
|
||||
|
||||
@ -107,7 +107,7 @@ dmap_add_int(struct evbuffer *evbuf, char *tag, int val)
|
||||
}
|
||||
|
||||
void
|
||||
dmap_add_short(struct evbuffer *evbuf, char *tag, short val)
|
||||
dmap_add_short(struct evbuffer *evbuf, const char *tag, short val)
|
||||
{
|
||||
unsigned char buf[6];
|
||||
|
||||
@ -127,7 +127,7 @@ dmap_add_short(struct evbuffer *evbuf, char *tag, short val)
|
||||
}
|
||||
|
||||
void
|
||||
dmap_add_char(struct evbuffer *evbuf, char *tag, char val)
|
||||
dmap_add_char(struct evbuffer *evbuf, const char *tag, char val)
|
||||
{
|
||||
unsigned char buf[5];
|
||||
|
||||
@ -146,7 +146,7 @@ dmap_add_char(struct evbuffer *evbuf, char *tag, char val)
|
||||
}
|
||||
|
||||
void
|
||||
dmap_add_literal(struct evbuffer *evbuf, char *tag, char *str, int len)
|
||||
dmap_add_literal(struct evbuffer *evbuf, const char *tag, char *str, int len)
|
||||
{
|
||||
char buf[4];
|
||||
|
||||
@ -179,7 +179,7 @@ dmap_add_raw_uint32(struct evbuffer *evbuf, uint32_t val)
|
||||
}
|
||||
|
||||
void
|
||||
dmap_add_string(struct evbuffer *evbuf, char *tag, const char *str)
|
||||
dmap_add_string(struct evbuffer *evbuf, const char *tag, const char *str)
|
||||
{
|
||||
unsigned char buf[4];
|
||||
int len;
|
||||
@ -341,12 +341,15 @@ dmap_add_field(struct evbuffer *evbuf, const struct dmap_field *df, char *strval
|
||||
|
||||
|
||||
void
|
||||
dmap_send_error(struct evhttp_request *req, char *container, char *errmsg)
|
||||
dmap_send_error(struct evhttp_request *req, const char *container, const char *errmsg)
|
||||
{
|
||||
struct evbuffer *evbuf;
|
||||
int len;
|
||||
int ret;
|
||||
|
||||
if (!req)
|
||||
return;
|
||||
|
||||
evbuf = evbuffer_new();
|
||||
if (!evbuf)
|
||||
{
|
||||
|
@ -54,35 +54,35 @@ dmap_find_field (register const char *str, register unsigned int len);
|
||||
|
||||
|
||||
void
|
||||
dmap_add_container(struct evbuffer *evbuf, char *tag, int len);
|
||||
dmap_add_container(struct evbuffer *evbuf, const char *tag, int len);
|
||||
|
||||
void
|
||||
dmap_add_long(struct evbuffer *evbuf, char *tag, int64_t val);
|
||||
dmap_add_long(struct evbuffer *evbuf, const char *tag, int64_t val);
|
||||
|
||||
void
|
||||
dmap_add_int(struct evbuffer *evbuf, char *tag, int val);
|
||||
dmap_add_int(struct evbuffer *evbuf, const char *tag, int val);
|
||||
|
||||
void
|
||||
dmap_add_short(struct evbuffer *evbuf, char *tag, short val);
|
||||
dmap_add_short(struct evbuffer *evbuf, const char *tag, short val);
|
||||
|
||||
void
|
||||
dmap_add_char(struct evbuffer *evbuf, char *tag, char val);
|
||||
dmap_add_char(struct evbuffer *evbuf, const char *tag, char val);
|
||||
|
||||
void
|
||||
dmap_add_literal(struct evbuffer *evbuf, char *tag, char *str, int len);
|
||||
dmap_add_literal(struct evbuffer *evbuf, const 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);
|
||||
dmap_add_string(struct evbuffer *evbuf, const char *tag, const char *str);
|
||||
|
||||
void
|
||||
dmap_add_field(struct evbuffer *evbuf, const struct dmap_field *df, char *strval, int32_t intval);
|
||||
|
||||
|
||||
void
|
||||
dmap_send_error(struct evhttp_request *req, char *container, char *errmsg);
|
||||
dmap_send_error(struct evhttp_request *req, const char *container, const char *errmsg);
|
||||
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user