mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-01-03 14:56:34 -05:00
Cleanup: Corrected names EVENT_EXTRA_* -> EVENT_EXTRA_KEY_*
This commit is contained in:
parent
4547264a8d
commit
b0bd9ef865
@ -457,10 +457,10 @@ void event_emit_va(const char *trigger, const char *uri, ...) {
|
||||
event->connection_id = client->con->id;
|
||||
event->connection_time = client->con->con_time;
|
||||
event->client_admin_command = client->admin_command;
|
||||
extra_add(event, EVENT_EXTRA_CONNECTION_IP, client->con->ip);
|
||||
extra_add(event, EVENT_EXTRA_CLIENT_ROLE, client->role);
|
||||
extra_add(event, EVENT_EXTRA_CLIENT_USERNAME, client->username);
|
||||
extra_add(event, EVENT_EXTRA_CLIENT_USERAGENT, httpp_getvar(client->parser, "user-agent"));
|
||||
extra_add(event, EVENT_EXTRA_KEY_CONNECTION_IP, client->con->ip);
|
||||
extra_add(event, EVENT_EXTRA_KEY_CLIENT_ROLE, client->role);
|
||||
extra_add(event, EVENT_EXTRA_KEY_CLIENT_USERNAME, client->username);
|
||||
extra_add(event, EVENT_EXTRA_KEY_CLIENT_USERAGENT, httpp_getvar(client->parser, "user-agent"));
|
||||
}
|
||||
} else {
|
||||
const char *value = va_arg(ap, const char *);
|
||||
|
@ -31,10 +31,10 @@ typedef enum {
|
||||
EVENT_EXTRA_CLIENT,
|
||||
/* real keys */
|
||||
EVENT_EXTRA_KEY_URI,
|
||||
EVENT_EXTRA_CONNECTION_IP,
|
||||
EVENT_EXTRA_CLIENT_ROLE,
|
||||
EVENT_EXTRA_CLIENT_USERNAME,
|
||||
EVENT_EXTRA_CLIENT_USERAGENT
|
||||
EVENT_EXTRA_KEY_CONNECTION_IP,
|
||||
EVENT_EXTRA_KEY_CLIENT_ROLE,
|
||||
EVENT_EXTRA_KEY_CLIENT_USERNAME,
|
||||
EVENT_EXTRA_KEY_CLIENT_USERAGENT
|
||||
} event_extra_key_t;
|
||||
|
||||
typedef struct {
|
||||
|
@ -152,10 +152,10 @@ static inline void __setup_environ(ice_config_t *config, event_exec_t *self, eve
|
||||
__update_environ("EVENT_TRIGGER", event->trigger); /* new name */
|
||||
__update_environ("SOURCE_ACTION", event->trigger); /* old name (deprecated) */
|
||||
__update_environ_with_key(event, "EVENT_URI", EVENT_EXTRA_KEY_URI);
|
||||
__update_environ_with_key(event, "CLIENT_IP", EVENT_EXTRA_CONNECTION_IP);
|
||||
__update_environ_with_key(event, "CLIENT_ROLE", EVENT_EXTRA_CLIENT_ROLE);
|
||||
__update_environ_with_key(event, "CLIENT_USERNAME", EVENT_EXTRA_CLIENT_USERNAME);
|
||||
__update_environ_with_key(event, "CLIENT_USERAGENT", EVENT_EXTRA_CLIENT_USERAGENT);
|
||||
__update_environ_with_key(event, "CLIENT_IP", EVENT_EXTRA_KEY_CONNECTION_IP);
|
||||
__update_environ_with_key(event, "CLIENT_ROLE", EVENT_EXTRA_KEY_CLIENT_ROLE);
|
||||
__update_environ_with_key(event, "CLIENT_USERNAME", EVENT_EXTRA_KEY_CLIENT_USERNAME);
|
||||
__update_environ_with_key(event, "CLIENT_USERAGENT", EVENT_EXTRA_KEY_CLIENT_USERAGENT);
|
||||
|
||||
snprintf(buf, sizeof(buf), "%lu", event->connection_id);
|
||||
__update_environ("CLIENT_ID", buf);
|
||||
|
@ -34,10 +34,10 @@ static int event_log_emit(void *state, event_t *event) {
|
||||
self->prefix ? self->prefix : "", self->prefix ? ": " : "",
|
||||
event->trigger,
|
||||
event_extra_get(event, EVENT_EXTRA_KEY_URI),
|
||||
event->connection_id, event_extra_get(event, EVENT_EXTRA_CONNECTION_IP), (long long int)event->connection_time,
|
||||
event_extra_get(event, EVENT_EXTRA_CLIENT_ROLE),
|
||||
event_extra_get(event, EVENT_EXTRA_CLIENT_USERNAME),
|
||||
event_extra_get(event, EVENT_EXTRA_CLIENT_USERAGENT),
|
||||
event->connection_id, event_extra_get(event, EVENT_EXTRA_KEY_CONNECTION_IP), (long long int)event->connection_time,
|
||||
event_extra_get(event, EVENT_EXTRA_KEY_CLIENT_ROLE),
|
||||
event_extra_get(event, EVENT_EXTRA_KEY_CLIENT_USERNAME),
|
||||
event_extra_get(event, EVENT_EXTRA_KEY_CLIENT_USERAGENT),
|
||||
event->client_admin_command);
|
||||
return 0;
|
||||
}
|
||||
|
@ -49,10 +49,10 @@ static int event_url_emit(void *state, event_t *event) {
|
||||
|
||||
action = util_url_escape(self->action ? self->action : event->trigger);
|
||||
mount = __escape(event_extra_get(event, EVENT_EXTRA_KEY_URI), "");
|
||||
role = __escape(event_extra_get(event, EVENT_EXTRA_CLIENT_ROLE), "");
|
||||
username = __escape(event_extra_get(event, EVENT_EXTRA_CLIENT_USERNAME), "");
|
||||
ip = __escape(event_extra_get(event, EVENT_EXTRA_CONNECTION_IP), "");
|
||||
agent = __escape(event_extra_get(event, EVENT_EXTRA_CLIENT_USERAGENT), "-");
|
||||
role = __escape(event_extra_get(event, EVENT_EXTRA_KEY_CLIENT_ROLE), "");
|
||||
username = __escape(event_extra_get(event, EVENT_EXTRA_KEY_CLIENT_USERNAME), "");
|
||||
ip = __escape(event_extra_get(event, EVENT_EXTRA_KEY_CONNECTION_IP), "");
|
||||
agent = __escape(event_extra_get(event, EVENT_EXTRA_KEY_CLIENT_USERAGENT), "-");
|
||||
|
||||
if (event->connection_time) {
|
||||
duration = time(NULL) - event->connection_time;
|
||||
|
Loading…
Reference in New Issue
Block a user