libidav/session.c

changeset 49
2f71f4ee247a
parent 18
af411868ab9b
--- a/libidav/session.c	Thu Oct 03 18:52:51 2024 +0200
+++ b/libidav/session.c	Sun Oct 06 18:18:04 2024 +0200
@@ -31,7 +31,6 @@
 #include <string.h>
 
 #include <cx/buffer.h>
-#include <cx/utils.h>
 #include <cx/mempool.h>
 #include <cx/hash_map.h>
 
@@ -119,7 +118,7 @@
 
     DavSession *newsn = malloc(sizeof(DavSession));
     memset(newsn, 0, sizeof(DavSession));
-    newsn->mp = cxMempoolCreate(DAV_SESSION_MEMPOOL_SIZE, NULL);
+    newsn->mp = cxBasicMempoolCreate(DAV_SESSION_MEMPOOL_SIZE);
     newsn->pathcache = cxHashMapCreate(sn->mp->allocator, CX_STORE_POINTERS, DAV_PATH_CACHE_SIZE);
     newsn->key = sn->key;
     newsn->errorstr = NULL;
@@ -636,16 +635,6 @@
     if(cxMapRemoveAndGet(locks->resource_locks, cx_hash_key_str(path))) {
         return;
     }
-    
-    CxMutIterator i = cxListMutIterator(locks->collection_locks);
-    int rm = 0;
-    cx_foreach(DavLock* , cl, i) {
-        if(rm) {
-            break;
-        }
-        if(cl == lock) {
-            cxIteratorFlagRemoval(i);
-            rm = 1;
-        }
-    }
+
+    cxListFindRemove(locks->collection_locks, lock);
 }

mercurial