Skip to content
This repository has been archived by the owner on Mar 12, 2019. It is now read-only.

Commit

Permalink
log cache & expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-Piet Mens committed Nov 3, 2014
1 parent f8b785a commit 3be6771
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void acl_cache(const char *clientid, const char *username, const char *topic, in
granted = a->granted;

if (time(NULL) > (a->seconds + cacheseconds)) {
_log(DEBUG, " Cache for (%s,%s,%d) [%s] Expired!", clientid, username, access,hex);
_log(DEBUG, " Expired [%s] for (%s,%s,%d)", hex, clientid, username, access);
HASH_DEL(ud->aclcache, a);
}
} else {
Expand All @@ -107,6 +107,7 @@ void acl_cache(const char *clientid, const char *username, const char *topic, in
a->granted = granted;
a->seconds = time(NULL);
HASH_ADD_STR(ud->aclcache, hex, a);
_log(DEBUG, " Cached [%s] for (%s,%s,%d)", hex, clientid, username, access);
}
}

Expand All @@ -127,7 +128,7 @@ int cache_q(const char *clientid, const char *username, const char *topic, int a
granted = a->granted;

if (time(NULL) > (a->seconds + cacheseconds)) {
_log(DEBUG, " Cache for (%s,%s,%d) [%s] Expired!", clientid, username, access,hex);
_log(DEBUG, " Expired [%s] for (%s,%s,%d)", hex, clientid, username, access);
HASH_DEL(ud->aclcache, a);
}
}
Expand Down

0 comments on commit 3be6771

Please sign in to comment.