X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=cache.c;fp=cache.c;h=8c851a39a9cce59e3020cb926e13c90d3df822d1;hb=479c7f8676d9cb6543ef516dc82cc53ed11b1142;hp=046e8b91f1828577cc4789f6da0b533254e7f774;hpb=65b3308d13de7d7975444d34389651612e2a4d38;p=project%2Fmdnsd.git diff --git a/cache.c b/cache.c index 046e8b9..8c851a3 100644 --- a/cache.c +++ b/cache.c @@ -42,7 +42,13 @@ static struct uloop_timeout cache_gc; struct avl_tree services; -AVL_TREE(records, avl_strcmp, true, NULL); + +static int avl_strcasecmp(const void *k1, const void *k2, void *ptr) +{ + return strcasecmp(k1, k2); +} + +AVL_TREE(records, avl_strcasecmp, true, NULL); static void cache_record_free(struct cache_record *r) @@ -111,7 +117,7 @@ cache_gc_timer(struct uloop_timeout *timeout) int cache_init(void) { - avl_init(&services, avl_strcmp, true, NULL); + avl_init(&services, avl_strcasecmp, true, NULL); cache_gc.cb = cache_gc_timer; uloop_timeout_set(&cache_gc, 10000);