src/server/daemon/config.c

changeset 625
a1e8a35c677a
parent 621
956c03c25edd
child 629
1e1da9adc532
equal deleted inserted replaced
624:e051cb8398cf 625:a1e8a35c677a
341 341
342 // search for VirtualServer 342 // search for VirtualServer
343 //int b = 0; 343 //int b = 0;
344 CxMapIterator map_iter = cxMapIteratorValues(serverconfig->host_vs); 344 CxMapIterator map_iter = cxMapIteratorValues(serverconfig->host_vs);
345 cx_foreach(VirtualServer *, vs, map_iter) { 345 cx_foreach(VirtualServer *, vs, map_iter) {
346 if(!cx_strcmp(vsname, cx_strn(vs->name.ptr, vs->name.length))) { 346 if(!cx_strcmp(vsname, vs->name)) {
347 listener->default_vs.vs = vs; 347 listener->default_vs.vs = vs;
348 break; 348 break;
349 } 349 }
350 } 350 }
351 } 351 }
782 return 1; 782 return 1;
783 } 783 }
784 784
785 // get a list of all DavBackends 785 // get a list of all DavBackends
786 for(ConfigNode *node=obj->children_begin;node;node=node->next) { 786 for(ConfigNode *node=obj->children_begin;node;node=node->next) {
787 cxstring node_name = cx_strn(node->name.ptr, node->name.length); 787 if(!cx_strcasecmp(node->name, cx_str("DavBackend"))) {
788 if(!cx_strcasecmp(node_name, cx_str("DavBackend"))) {
789 if(node->type == CONFIG_NODE_DIRECTIVE) { 788 if(node->type == CONFIG_NODE_DIRECTIVE) {
790 if(CFG_NUM_PARAMS(node->args) == 1) { 789 if(CFG_NUM_PARAMS(node->args) == 1) {
791 cxListAdd(backends, node->args); 790 cxListAdd(backends, node->args);
792 } else { 791 } else {
793 log_ereport(LOG_MISCONFIG, "DavBackend must have only one value"); 792 log_ereport(LOG_MISCONFIG, "DavBackend must have only one value");
1156 // add ext type pairs 1155 // add ext type pairs
1157 for(MimeDirective *d=mimecfg->directives_begin;d;d=d->next) { 1156 for(MimeDirective *d=mimecfg->directives_begin;d;d=d->next) {
1158 // add the type for each extension to the map 1157 // add the type for each extension to the map
1159 for(int i=0;i<d->nextensions;i++) { 1158 for(int i=0;i<d->nextensions;i++) {
1160 cxstring ext = d->extensions[i]; 1159 cxstring ext = d->extensions[i];
1161 cxmutstr value = cx_strdup_a(cfg->a, cx_strn(d->type.ptr, d->type.length)); 1160 cxmutstr value = cx_strdup_a(cfg->a, d->type);
1162 if(cxMapPut(map, cx_hash_key_bytes((const unsigned char *)ext.ptr, ext.length), value.ptr)) { 1161 if(cxMapPut(map, ext, value.ptr)) {
1163 log_ereport(LOG_CATASTROPHE, "OOM"); 1162 log_ereport(LOG_CATASTROPHE, "OOM");
1164 ret = -1; 1163 ret = -1;
1165 break; 1164 break;
1166 } 1165 }
1167 } 1166 }
1212 acllist->acl.authprompt = NULL; 1211 acllist->acl.authprompt = NULL;
1213 acllist->acl.isextern = 0; 1212 acllist->acl.isextern = 0;
1214 acllist->ace = NULL; 1213 acllist->ace = NULL;
1215 acllist->ece = NULL; 1214 acllist->ece = NULL;
1216 1215
1217 if(acl->type.ptr && !cx_strcmp(cx_strn(acl->type.ptr, acl->type.length), cx_str("fs"))) { 1216 if(acl->type.ptr && !cx_strcmp(acl->type, CX_STR("fs"))) {
1218 acllist->acl.isextern = 1; 1217 acllist->acl.isextern = 1;
1219 } 1218 }
1220 1219
1221 size_t s = CFG_ACE_LIST_SIZE(acl->entries); 1220 size_t s = CFG_ACE_LIST_SIZE(acl->entries);
1222 WSAce **tmp_aces = calloc(s, sizeof(WSAce*)); 1221 WSAce **tmp_aces = calloc(s, sizeof(WSAce*));

mercurial