diff options
Diffstat (limited to 'src/libdcache/dcache_search.c')
-rw-r--r-- | src/libdcache/dcache_search.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/libdcache/dcache_search.c b/src/libdcache/dcache_search.c deleted file mode 100644 index 3d79dd6..0000000 --- a/src/libdcache/dcache_search.c +++ /dev/null @@ -1,24 +0,0 @@ -/* ISC license. */ - -#include <stdint.h> - -#include <skalibs/avltree.h> - -#include <shibari/dcache.h> -#include "dcache-internal.h" - -dcache_node_t *dcache_search (dcache_t *z, char const *key, uint16_t keylen, tain const *stamp) -{ - uint32_t i ; - dcache_key_t k = { .s = (char *)key, .len = keylen } ; - if (avltree_search(&z->by_key, &k, &i)) - { - if (tain_less(&DNODE(z, i)->expire, stamp)) - { - dcache_clean_expired(z, stamp) ; - if (!avltree_search(&z->by_key, &k, &i)) return 0 ; - } - return DNODE(z, i) ; - } - else return 0 ; -} |