1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Feature: Added support to query the name of a event extra key

This commit is contained in:
Philipp Schafft 2022-09-17 16:20:25 +00:00
parent 2db94a2a81
commit 7d889b7294
2 changed files with 18 additions and 0 deletions

View File

@ -73,6 +73,23 @@ const char * event_extra_get(const event_t *event, const event_extra_key_t key)
return NULL;
}
const char * event_extra_key_name(event_extra_key_t key)
{
switch (key) {
case EVENT_EXTRA_KEY_URI: return "uri"; break;
case EVENT_EXTRA_KEY_CONNECTION_IP: return "connection-id"; break;
case EVENT_EXTRA_KEY_CLIENT_ROLE: return "client-role"; break;
case EVENT_EXTRA_KEY_CLIENT_USERNAME: return "client-username"; break;
case EVENT_EXTRA_KEY_CLIENT_USERAGENT: return "client-useragent"; break;
case EVENT_EXTRA_KEY_SOURCE_MEDIA_TYPE: return "source-mediatype"; break;
#ifndef DEVEL_LOGGING
default: break;
#endif
}
return NULL;
}
/* work with event_t* */
static void event_addref(event_t *event) {
if (!event)

View File

@ -124,6 +124,7 @@ void event_emit_va(const char *trigger, ...);
/* reading extra from events */
const char * event_extra_get(const event_t *event, const event_extra_key_t key);
const char * event_extra_key_name(event_extra_key_t key);
/* Implementations */
int event_get_exec(event_registration_t *er, config_options_t *options);