diff -r 279f343bbf6c -r fac51f87def0 src/server/daemon/config.c --- a/src/server/daemon/config.c Wed Jul 31 13:02:06 2013 +0200 +++ b/src/server/daemon/config.c Sun Sep 08 23:27:07 2013 +0200 @@ -66,10 +66,10 @@ fprintf(stderr, "Cannot load init.conf\n"); return 1; } - UcxMempool *mp = cfg->parser.mp; + UcxAllocator *mp = cfg->parser.mp; cfg_pool = pool_create(); // one pool for one Configuration - UcxDlist *dirs = cfg->directives; + UcxList *dirs = cfg->directives; while(dirs != NULL) { ConfigDirective *dir = dirs->data; @@ -178,7 +178,7 @@ } UcxList *list = ucx_map_sstr_get(serverconf->objects, sstrn("Runtime", 7)); - UCX_FOREACH(UcxList*, list, elm) { + UCX_FOREACH(elm, list) { ServerConfigObject *scfgobj = elm->data; if(cfg_handle_runtime(serverconfig, scfgobj)) { // error @@ -187,7 +187,7 @@ } list = ucx_map_sstr_get(serverconf->objects, sstrn("Threadpool", 10)); - UCX_FOREACH(UcxList*, list, elm) { + UCX_FOREACH(elm, list) { if(cfg_handle_threadpool(serverconfig, elm->data)) { return NULL; } @@ -199,7 +199,7 @@ } list = ucx_map_sstr_get(serverconf->objects, sstrn("EventHandler", 12)); - UCX_FOREACH(UcxList*, list, elm) { + UCX_FOREACH(elm, list) { if(cfg_handle_eventhandler( serverconfig, (ServerConfigObject*)elm->data)) { // error @@ -213,7 +213,7 @@ } list = ucx_map_sstr_get(serverconf->objects, sstrn("AccessLog", 9)); - UCX_FOREACH(UcxList*, list, elm) { + UCX_FOREACH(elm, list) { ServerConfigObject *scfgobj = elm->data; if(cfg_handle_accesslog(serverconfig, scfgobj)) { return NULL; @@ -221,7 +221,7 @@ } list = ucx_map_sstr_get(serverconf->objects, sstrn("AuthDB", 6)); - UCX_FOREACH(UcxList*, list, elm) { + UCX_FOREACH(elm, list) { ServerConfigObject *scfgobj = elm->data; if(cfg_handle_authdb(serverconfig, scfgobj)) { return NULL; @@ -229,7 +229,7 @@ } list = ucx_map_sstr_get(serverconf->objects, sstrn("Listener", 8)); - UCX_FOREACH(UcxList*, list, elm) { + UCX_FOREACH(elm, list) { ServerConfigObject *scfgobj = elm->data; if(cfg_handle_listener(serverconfig, scfgobj)) { return NULL; @@ -237,7 +237,7 @@ } list = ucx_map_sstr_get(serverconf->objects, sstrn("VirtualServer", 13)); - UCX_FOREACH(UcxList*, list, elm) { + UCX_FOREACH(elm, list) { ServerConfigObject *scfgobj = elm->data; if(cfg_handle_vs(serverconfig, scfgobj)) { return NULL; @@ -290,7 +290,7 @@ int cfg_handle_runtime(ServerConfiguration *cfg, ServerConfigObject *obj) { sstr_t user = cfg_directivelist_get_str(obj->directives, sstr("User")); if(user.ptr) { - cfg->user = sstrdup_pool(cfg->pool, user); + //cfg->user = sstrdup_pool(cfg->pool, user); } sstr_t tmp = cfg_directivelist_get_str(obj->directives, sstr("Temp")); if(tmp.ptr) { @@ -308,7 +308,7 @@ file.length = base.length + mf.length; file.ptr = alloca(file.length + 1); file.ptr[file.length] = 0; - file = sstrncat(2, file, base, mf); + file = sstrncat(file, 2, base, mf); ConfigFile *f = cfgmgr_get_file(file); if(f == NULL) { @@ -610,7 +610,7 @@ file.length = base.length + objfile.length + 1; file.ptr = alloca(file.length); file.ptr[file.length] = 0; - file = sstrncat(2, file, base, objfile); + file = sstrncat(file, 2, base, objfile); // the file is managed by the configuration manager ConfigFile *f = cfgmgr_get_file(file); @@ -635,7 +635,7 @@ file.length = base.length + aclfile.length + 1; file.ptr = alloca(file.length); file.ptr[file.length] = 0; - file = sstrncat(2, file, base, aclfile); + file = sstrncat(file, 2, base, aclfile); ConfigFile *aclf = cfgmgr_get_file(file); if(aclf == NULL) { @@ -696,7 +696,7 @@ // new conf function test ObjectConfig *cfg = load_object_config(file); - UcxMempool *mp = cfg->parser.mp; + UcxAllocator *mp = cfg->parser.mp; if(cfg == NULL) { return NULL; } @@ -709,10 +709,10 @@ // convert ObjectConfig to HTTPObjectConfig // add objects - conf->nobj = ucx_dlist_size(cfg->objects); + conf->nobj = ucx_list_size(cfg->objects); conf->objects = pool_calloc(pool, conf->nobj, sizeof(httpd_object*)); - UcxDlist *objlist = cfg->objects; + UcxList *objlist = cfg->objects; int i = 0; while(objlist != NULL) { ConfigObject *cob = objlist->data; @@ -735,7 +735,7 @@ // add directives for(int i=0;i<6;i++) { - UcxDlist *dirs = cob->directives[i]; + UcxList *dirs = cob->directives[i]; while(dirs != NULL) { ConfigDirective *cfgdir = dirs->data; @@ -792,10 +792,10 @@ mimemap->map = map; // add ext type pairs - UCX_FOREACH(UcxList*, mimecfg->directives, md) { + UCX_FOREACH(md, mimecfg->directives) { MimeDirective *d = md->data; // add the type for each extension to the map - UCX_FOREACH(UcxList*, d->exts, xl) { + UCX_FOREACH(xl, d->exts) { sstr_t ext = sstr(xl->data); sstr_t value = sstrdup(d->type); ucx_map_sstr_put(map, ext, value.ptr); @@ -836,7 +836,7 @@ ACLFile *aclfile = load_acl_file(file->file.ptr); ACLData *acldata = acl_data_new(); - UCX_FOREACH(UcxList*, aclfile->namedACLs, elm) { + UCX_FOREACH(elm, aclfile->namedACLs) { ACLConfig *ac = elm->data; ACLList *acl = acl_config_convert(cfg, ac); printf("put acl: %s\n", ac->id.ptr); @@ -874,7 +874,7 @@ int ei = 0; // convert entries - UCX_FOREACH(UcxList*, acl->entries, elm) { + UCX_FOREACH(elm, acl->entries) { ACEConfig *acecfg = elm->data; // copy data @@ -934,7 +934,7 @@ Keyfile *keyfile = keyfile_new(); - UCX_FOREACH(UcxList*, conf->users, elm) { + UCX_FOREACH(elm, conf->users) { KeyfileEntry *user = elm->data; keyfile_add_user( keyfile,