From: Fabian Keil <fk@fabiankeil.de>
Date: Mon, 20 Feb 2017 13:47:51 +0000 (+0000)
Subject: add_tag_for_client(): Set time_to_live properly
X-Git-Tag: v_3_0_27~213
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@edit-actions-section-add?a=commitdiff_plain;h=59d5e640ca88c6e16c4458e4a90d3bca69db1ec5;p=privoxy.git

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.
---

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;