Commit 23a47c8f authored by Philipp Schafft's avatar Philipp Schafft 🦁

in <listener>:

- Added <role>.
- Converted <Referer> to <referer>.
- Set id="nnn" in addition to <ID>nnn</ID>.
- Added TAGged comments about next steps.

refs #2097

svn path=/icecast/trunk/icecast/; revision=19364
parent fa9ab8ee
...@@ -663,12 +663,11 @@ static inline xmlNodePtr __add_listener(client_t *client, xmlNodePtr parent, tim ...@@ -663,12 +663,11 @@ static inline xmlNodePtr __add_listener(client_t *client, xmlNodePtr parent, tim
xmlNodePtr node; xmlNodePtr node;
char buf[22]; char buf[22];
#if 0 /* TODO: kh has support for a child node "lag". We should add that.
xmlSetProp (node, XMLSTR("id"), XMLSTR(buf)); * BEFORE RELEASE 2.5.0 REVIEW #2097: Check if we are on-track for lowercasing child nodes.
* BEFORE RELEASE 2.6.0 TODO #2097: Change case of child nodes to lower case.
xmlNewChild (node, NULL, XMLSTR("lag"), XMLSTR(buf)); * The case of <ID>, <IP>, <UserAgent> and <Connected> should be converted to lower case.
*/
#endif
node = xmlNewChild(parent, NULL, XMLSTR("listener"), NULL); node = xmlNewChild(parent, NULL, XMLSTR("listener"), NULL);
if (!node) if (!node)
...@@ -676,6 +675,7 @@ static inline xmlNodePtr __add_listener(client_t *client, xmlNodePtr parent, tim ...@@ -676,6 +675,7 @@ static inline xmlNodePtr __add_listener(client_t *client, xmlNodePtr parent, tim
memset(buf, '\000', sizeof(buf)); memset(buf, '\000', sizeof(buf));
snprintf(buf, sizeof(buf)-1, "%lu", client->con->id); snprintf(buf, sizeof(buf)-1, "%lu", client->con->id);
xmlSetProp(node, XMLSTR("id"), XMLSTR(buf));
xmlNewChild(node, NULL, XMLSTR("ID"), XMLSTR(buf)); xmlNewChild(node, NULL, XMLSTR("ID"), XMLSTR(buf));
xmlNewChild(node, NULL, XMLSTR("IP"), XMLSTR(client->con->ip)); xmlNewChild(node, NULL, XMLSTR("IP"), XMLSTR(client->con->ip));
...@@ -686,7 +686,7 @@ static inline xmlNodePtr __add_listener(client_t *client, xmlNodePtr parent, tim ...@@ -686,7 +686,7 @@ static inline xmlNodePtr __add_listener(client_t *client, xmlNodePtr parent, tim
tmp = httpp_getvar(client->parser, "referer"); tmp = httpp_getvar(client->parser, "referer");
if (tmp) if (tmp)
xmlNewChild(node, NULL, XMLSTR("Referer"), XMLSTR(tmp)); xmlNewChild(node, NULL, XMLSTR("referer"), XMLSTR(tmp));
memset(buf, '\000', sizeof(buf)); memset(buf, '\000', sizeof(buf));
snprintf(buf, sizeof(buf), "%lu", (unsigned long)(now - client->con->con_time)); snprintf(buf, sizeof(buf), "%lu", (unsigned long)(now - client->con->con_time));
...@@ -695,6 +695,9 @@ static inline xmlNodePtr __add_listener(client_t *client, xmlNodePtr parent, tim ...@@ -695,6 +695,9 @@ static inline xmlNodePtr __add_listener(client_t *client, xmlNodePtr parent, tim
if (client->username) if (client->username)
xmlNewChild(node, NULL, XMLSTR("username"), XMLSTR(client->username)); xmlNewChild(node, NULL, XMLSTR("username"), XMLSTR(client->username));
if (client->role)
xmlNewChild(node, NULL, XMLSTR("role"), XMLSTR(client->role));
return node; return node;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment