From 59d5e640ca88c6e16c4458e4a90d3bca69db1ec5 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Mon, 20 Feb 2017 13:47:51 +0000 Subject: [PATCH] add_tag_for_client(): Set time_to_live properly Previously the time_to_live was always set for the first tag. Attempts to temporarily enable a tag would result in enabling it permanently unless no tag was enabled already. D'oh. --- client-tags.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client-tags.c b/client-tags.c index f9b38c9c..d9816888 100644 --- a/client-tags.c +++ b/client-tags.c @@ -372,7 +372,7 @@ static void add_tag_for_client(const char *client_address, { enabled_tags->next = zalloc_or_die(sizeof(struct client_specific_tag)); enabled_tags->next->name = strdup_or_die(tag); - clients_with_tags->tags->end_of_life = time_to_live ? + enabled_tags->next->end_of_life = time_to_live ? (time(NULL) + time_to_live) : 0; enabled_tags->next->prev = enabled_tags; break; -- 2.39.2