diff -r 921f83a8943f -r d218607f5a7e src/server/daemon/config.c --- a/src/server/daemon/config.c Sat Mar 25 17:18:51 2023 +0100 +++ b/src/server/daemon/config.c Fri May 05 18:02:11 2023 +0200 @@ -163,12 +163,12 @@ CxAllocator *allocator = pool_allocator(serverconfig->pool); serverconfig->a = allocator; - serverconfig->listeners = cxPointerLinkedListCreate(serverconfig->a, cx_cmp_ptr); - serverconfig->logfiles = cxPointerLinkedListCreate(serverconfig->a, cx_cmp_ptr); - serverconfig->host_vs = cxHashMapCreate(serverconfig->a, 16); - serverconfig->authdbs = cxHashMapCreate(serverconfig->a, 16); - serverconfig->resources = cxHashMapCreate(serverconfig->a, 16); - serverconfig->dav = cxHashMapCreate(serverconfig->a, 16); + serverconfig->listeners = cxLinkedListCreate(serverconfig->a, NULL, CX_STORE_POINTERS); + serverconfig->logfiles = cxLinkedListCreate(serverconfig->a, NULL, CX_STORE_POINTERS); + serverconfig->host_vs = cxHashMapCreate(serverconfig->a, CX_STORE_POINTERS, 16); + serverconfig->authdbs = cxHashMapCreate(serverconfig->a, CX_STORE_POINTERS, 16); + serverconfig->resources = cxHashMapCreate(serverconfig->a, CX_STORE_POINTERS, 16); + serverconfig->dav = cxHashMapCreate(serverconfig->a, CX_STORE_POINTERS, 16); // STAGE 1 load_server_conf: // At stage 1 we load the file and get the Runtime infos for changing @@ -181,7 +181,7 @@ // load Runtime config CxList *list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("Runtime")); - CxIterator iter = cxListIterator(list, 0); + CxIterator iter = cxListIterator(list); cx_foreach(ConfigNode *, runtimeobj, iter) { if(cfg_handle_runtime(serverconfig, runtimeobj)) { // error @@ -194,7 +194,7 @@ // load threadpool config log_ereport(LOG_DEBUG, "apply config: Threadpool"); list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("Threadpool")); - iter = cxListIterator(list, 0); + iter = cxListIterator(list); cx_foreach(ConfigNode *, elm, iter) { if(cfg_handle_threadpool(serverconfig, elm)) { log_ereport(LOG_FAILURE, "server.conf threadpool"); @@ -211,7 +211,7 @@ // load eventhandler config log_ereport(LOG_DEBUG, "apply config: EventHandler"); list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("EventHandler")); - iter = cxListIterator(list, 0); + iter = cxListIterator(list); cx_foreach(ConfigNode *, elm, iter) { if(cfg_handle_eventhandler(serverconfig, elm)) { // error @@ -229,7 +229,7 @@ // load Listener config log_ereport(LOG_DEBUG, "apply config: Listener"); list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("Listener")); - iter = cxListIterator(list, 0); + iter = cxListIterator(list); cx_foreach(ConfigNode *, scfgobj, iter) { if(cfg_handle_listener(serverconfig, scfgobj)) { return NULL; @@ -263,7 +263,7 @@ log_ereport(LOG_DEBUG, "apply config: LogFile"); list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("LogFile")); - CxIterator iter = cxListIterator(list, 0); + CxIterator iter = cxListIterator(list); cx_foreach(ConfigNode *, logobj, iter) { if(!logobj) { // error @@ -282,7 +282,7 @@ log_ereport(LOG_DEBUG, "apply config: AccessLog"); list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("AccessLog")); - iter = cxListIterator(list, 0); + iter = cxListIterator(list); cx_foreach(ConfigNode *, scfgobj, iter) { if(cfg_handle_accesslog(serverconfig, scfgobj)) { return NULL; @@ -292,7 +292,7 @@ log_ereport(LOG_DEBUG, "apply config: AuthDB"); list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("AuthDB")); - iter = cxListIterator(list, 0); + iter = cxListIterator(list); cx_foreach(ConfigNode *, scfgobj, iter) { if(cfg_handle_authdb(serverconfig, scfgobj)) { return NULL; @@ -302,7 +302,7 @@ log_ereport(LOG_DEBUG, "apply config: VirtualServer"); list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("VirtualServer")); - iter = cxListIterator(list, 0); + iter = cxListIterator(list); cx_foreach(ConfigNode *, scfgobj, iter) { if(cfg_handle_vs(serverconfig, scfgobj)) { return NULL; @@ -312,7 +312,7 @@ log_ereport(LOG_DEBUG, "apply config: ResourcePool"); list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("ResourcePool")); - iter = cxListIterator(list, 0); + iter = cxListIterator(list); cx_foreach(ConfigNode *, scfgobj, iter) { if(cfg_handle_resourcepool(serverconfig, scfgobj)) { return NULL; @@ -322,7 +322,7 @@ log_ereport(LOG_DEBUG, "apply config: Dav"); list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, cx_str("Dav")); - iter = cxListIterator(list, 0); + iter = cxListIterator(list); cx_foreach(ConfigNode *, scfgobj, iter) { if(cfg_handle_dav(serverconfig, scfgobj)) { return NULL; @@ -332,7 +332,7 @@ // set VirtualServer for all listeners CxList *ls = serverconfig->listeners; - iter = cxListIterator(ls, 0); + iter = cxListIterator(ls); cx_foreach(HttpListener *, listener, iter) { cxstring vsname = cx_str(listener->default_vs.vs_name); @@ -358,7 +358,7 @@ // compare old/new listeners and set next listener, if they are using // the same socket - CxIterator old_listeners = cxListIterator(old_cfg->listeners, 0); + CxIterator old_listeners = cxListIterator(old_cfg->listeners); cx_foreach(HttpListener*, oldls, old_listeners) { if(oldls->next) { // maybe we can remove this check @@ -366,7 +366,7 @@ continue; } - CxIterator new_listeners = cxListIterator(new_cfg->listeners, 0); + CxIterator new_listeners = cxListIterator(new_cfg->listeners); cx_foreach(HttpListener*, newls, new_listeners) { if(http_listener_socket_eq(oldls, newls)) { http_listener_set_next(oldls, newls); @@ -393,7 +393,7 @@ } log_ereport(LOG_VERBOSE, "destroy configuration %p", cfg); - CxIterator i = cxListIterator(cfg->listeners, 0); + CxIterator i = cxListIterator(cfg->listeners); cx_foreach(HttpListener*, listener, i) { http_listener_destroy(listener); } @@ -750,7 +750,7 @@ int cfg_handle_dav(ServerConfiguration *cfg, ConfigNode *obj) { CxAllocator *a = pool_allocator(cfg->pool); - CxList *backends = cxPointerLinkedListCreate(a, cx_cmp_ptr); // list of ConfigParam* + CxList *backends = cxLinkedListCreate(a, NULL, CX_STORE_POINTERS); // list of ConfigParam* int init_error; // parse args @@ -798,10 +798,10 @@ WebdavRepository *repository = pool_malloc(cfg->pool, sizeof(WebdavRepository)); repository->vfs = NULL; repository->vfsInitData = NULL; - repository->davBackends = cxPointerLinkedListCreate(a, cx_cmp_ptr); // value type: WebdavBackendInitData* + repository->davBackends = cxLinkedListCreate(a, NULL, CX_STORE_POINTERS); // value type: WebdavBackendInitData* // initialize backends - CxIterator i = cxListIterator(backends, 0); + CxIterator i = cxListIterator(backends); cx_foreach(ConfigParam *, backendArg, i) { // the DavBackend value should contain the dav class name @@ -886,7 +886,7 @@ // list of cxmutstr, however the expression parser will use this // as list of cxstring, but that is totally fine - CxList *tokens = cxLinkedListCreate(pool_allocator(pool), cx_cmp_ptr, sizeof(cxmutstr)); + CxList *tokens = cxLinkedListCreate(pool_allocator(pool), NULL, sizeof(cxmutstr)); ConfigParam *arg = node->args; while(arg) { if(arg->name.length > 0) { @@ -1140,7 +1140,7 @@ // cleanup in case of errors is done by the allocator MimeMap *mimemap = cxMalloc(cfg->a, sizeof(MimeMap)); - CxMap *map = cxHashMapCreate(cfg->a, (mimecfg->ntypes * 3) / 2); + CxMap *map = cxHashMapCreate(cfg->a, CX_STORE_POINTERS, (mimecfg->ntypes * 3) / 2); if(mimemap && map) { mimemap->map = map; @@ -1184,7 +1184,7 @@ // TODO: malloc return checks ACLData *acldata = acl_data_new(cfg->a); - CxIterator iter = cxListIterator(aclfile->namedACLs, 0); + CxIterator iter = cxListIterator(aclfile->namedACLs); cx_foreach(ACLConfig *, ac, iter) { ACLList *acl = acl_config_convert(cfg, ac); log_ereport(LOG_VERBOSE, "add acl: %.*s", (int)ac->id.length, ac->id.ptr);