1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

Feature: Record source creation time

This commit is contained in:
Philipp Schafft 2022-03-31 23:19:18 +00:00
parent 7e924934e8
commit 35415d93a8
2 changed files with 7 additions and 1 deletions

View File

@ -290,6 +290,7 @@ void source_clear_source (source_t *source)
source->hidden = 0;
source->shoutcast_compat = 0;
source->last_stats_update = 0;
source->create_time = 0;
source->flags = 0;
util_dict_free(source->audio_info);
source->audio_info = NULL;
@ -641,6 +642,7 @@ static void source_init (source_t *source)
{
char listenurl[512];
const char *str;
time_t now;
str = httpp_getvar(source->parser, "ice-audio-info");
source->audio_info = util_dict_new();
@ -668,8 +670,11 @@ static void source_init (source_t *source)
stats_event_time (source->mount, "stream_start");
stats_event_time_iso8601 (source->mount, "stream_start_iso8601");
now = time(NULL);
source->last_read = now;
source->create_time = now;
ICECAST_LOG_DEBUG("Source creation complete");
source->last_read = time (NULL);
source->prev_listeners = -1;
source->running = 1;

View File

@ -43,6 +43,7 @@ struct source_tag {
connection_t *con;
http_parser_t *parser;
time_t last_stats_update;
time_t create_time;
char *mount; // TODO: Should we at some point migrate away from this to only use identifier?
mount_identifier_t *identifier;