summaryrefslogtreecommitdiff
path: root/src/libdcache/dcache_searchnode.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-09-13 09:38:07 +0000
committerLaurent Bercot <ska@appnovation.com>2024-09-13 09:38:07 +0000
commitfb355e4200fcf98f36a4f3e1fbeb1e16b4761ee6 (patch)
treebf78792e9206e121607ad786432c0b60bbdcdc72 /src/libdcache/dcache_searchnode.c
parent45c04a53fb9fbefe4dd86514c7563b4af1961dfb (diff)
downloadshibari-main.tar.xz
Push what I have for nowHEADmain
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libdcache/dcache_searchnode.c')
-rw-r--r--src/libdcache/dcache_searchnode.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/libdcache/dcache_searchnode.c b/src/libdcache/dcache_searchnode.c
deleted file mode 100644
index ef7341c..0000000
--- a/src/libdcache/dcache_searchnode.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ISC license. */
-
-#include <stdint.h>
-
-#include <skalibs/uint16.h>
-#include <skalibs/avltree.h>
-
-#include <shibari/dcache.h>
-#include "dcache-internal.h"
-
-int dcache_searchnode (dcache *z, uint32_t *idx, char const *q, uint16_t qlen, uint16_t qtype, tai const *stamp)
-{
- dcache_node *node ;
- uint32_t i ;
- char key[4 + qlen] ;
- uint16_pack_big(key, qtype) ;
- uint16_pack_big(key+2, qlen) ;
- memcpy(key+4, q, qlen) ;
- if (!avltree_search(&z->by_key, &k, &i)) return -1 ;
- node = DNODE(z, i) ;
- if (node->sa.len == node->sa.a && !tai_less(stamp, &node->expire))
- {
- dcache_delete(z, i) ;
- return -1 ;
- }
- *idx = i ;
- return node->sa.len == node->sa.a ;
-}