Rebuild HTML docs
[privoxy.git] / client-tags.c
index e04345c..0bcbf35 100644 (file)
@@ -28,6 +28,8 @@
 
 #include "config.h"
 
+#ifdef FEATURE_CLIENT_TAGS
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <stdlib.h>
@@ -363,6 +365,13 @@ static void remove_tag_for_client(const char *client_address, const char *tag)
       clients_with_tags = clients_with_tags->next;
    }
 
+   assert(clients_with_tags != NULL);
+   if (clients_with_tags == NULL)
+   {
+      log_error(LOG_LEVEL_ERROR,
+         "Tried to remove tag %s for tag-less client %s",
+         tag, client_address);
+   }
    enabled_tags = clients_with_tags->tags;
    while (enabled_tags != NULL)
    {
@@ -491,7 +500,8 @@ jb_err enable_client_specific_tag(struct client_state *csp,
    {
       add_tag_for_client(csp->ip_addr_str, tag_name, time_to_live);
       log_error(LOG_LEVEL_INFO,
-         "Tag '%s' enabled for client '%s'", tag->name, csp->ip_addr_str);
+         "Tag '%s' enabled for client '%s'. TTL: %d.",
+         tag->name, csp->ip_addr_str, time_to_live);
    }
 
    privoxy_mutex_unlock(&client_tags_mutex);
@@ -585,3 +595,6 @@ int client_tag_match(const struct pattern_spec *pattern,
    return 0;
 
 }
+#else
+#error Compiling client-tags.c without FEATURE_CLIENT_TAGS
+#endif /* def FEATURE_CLIENT_TAGS */