diff -r 99a34860c105 -r d938228c382e src/server/webdav/requestparser.c --- a/src/server/webdav/requestparser.c Wed Nov 02 19:19:01 2022 +0100 +++ b/src/server/webdav/requestparser.c Sun Nov 06 15:53:32 2022 +0100 @@ -30,13 +30,16 @@ #include #include -#include -#include -#include +#include +#include +#include +#include #include "requestparser.h" #include "webdav.h" +#include "../util/pool.h" + #define xstreq(a, b) !strcmp((const char*)a, (const char*)b) void proplist_free(pool_handle_t *pool, WebdavPList *list) { @@ -63,7 +66,7 @@ static int parse_prop( Session *sn, xmlNode *node, - UcxMap *propmap, + CxMap *propmap, WebdavPList **plist_begin, WebdavPList **plist_end, size_t *propcount, @@ -80,14 +83,14 @@ const char* name = (const char*)pnode->name; // check for prop duplicates - UcxKey k = webdav_property_key((const char*)ns, (const char*)name); - if(!k.data) { + CxHashKey k = webdav_property_key((const char*)ns, (const char*)name); + if(!k.data.bytes) { *error = proppatch ? PROPPATCH_PARSER_OOM : PROPFIND_PARSER_OOM; return 1; } - void *c = ucx_map_get(propmap, k); + void *c = cxMapGet(propmap, k); if(!c) { - if(ucx_map_put(propmap, k, (void*)1)) { + if(cxMapPut(propmap, k, (void*)1)) { *error = proppatch ? PROPPATCH_PARSER_OOM : PROPFIND_PARSER_OOM; } @@ -111,7 +114,7 @@ *error = PROPPATCH_PARSER_DUPLICATE; } - free((void*)k.data); + free((void*)k.data.str); if(*error) { return 1; } @@ -156,7 +159,8 @@ return NULL; } - UcxMap *propmap = ucx_map_new(32); + CxAllocator *a = pool_allocator(sn->pool); + CxMap *propmap = cxHashMapCreate(a, 32); // value: intptr_t if(!propmap) { *error = PROPFIND_PARSER_OOM; xmlFreeDoc(doc); @@ -190,7 +194,7 @@ node = node->next; } - ucx_map_free(propmap); // no allocated content must be freed + cxMapDestroy(propmap); // no allocated content must be freed if(ret) { // parse_prop failed @@ -295,7 +299,10 @@ // ret vars *error = 0; - UcxMap *propmap = ucx_map_new(32); // map for duplicate checking + CxAllocator *a = pool_allocator(sn->pool); + // map for duplicate checking + // value type: intptr_t + CxMap *propmap = cxHashMapCreate(a, 32); if(!propmap) { *error = PROPPATCH_PARSER_OOM; xmlFreeDoc(doc); @@ -350,7 +357,7 @@ node = node->next; } - ucx_map_free(propmap); // allocated content must not be freed + cxMapDestroy(propmap); // allocated content must not be freed if(set_count + remove_count == 0) { *error = PROPPATCH_PARSER_NO_PROPERTIES;