src/server/daemon/config.c

branch
webdav
changeset 367
1592224f6059
parent 366
47bc686fafe4
child 368
69dbcc7e7f93
equal deleted inserted replaced
366:47bc686fafe4 367:1592224f6059
679 int cfg_handle_dav(ServerConfiguration *cfg, ConfigNode *obj) { 679 int cfg_handle_dav(ServerConfiguration *cfg, ConfigNode *obj) {
680 UcxList *backends = NULL; // list of ConfigArg* 680 UcxList *backends = NULL; // list of ConfigArg*
681 UcxAllocator a = util_pool_allocator(cfg->pool); 681 UcxAllocator a = util_pool_allocator(cfg->pool);
682 int init_error; 682 int init_error;
683 683
684 // parse args
685 char *uri = NULL;
686 char *ppath = NULL;
687 char *name = NULL;
688 UCX_FOREACH(elm, obj->args) {
689 ConfigArg *arg = elm->data;
690 if(arg->name.ptr == NULL) {
691 // default: uri
692 uri = arg->value.ptr;
693 } else if(!sstrcasecmp(arg->name, SC("uri"))) {
694 uri = arg->value.ptr;
695 } else if(!sstrcasecmp(arg->name, SC("ppath"))) {
696 ppath = arg->value.ptr;
697 } else if(!sstrcasecmp(arg->name, SC("name"))) {
698 name = arg->value.ptr;
699 }
700 }
701 if(!uri && !ppath && !name) {
702 return 1;
703 }
704
684 // get a list of all DavBackends 705 // get a list of all DavBackends
685 UCX_FOREACH(elm, obj->children) { 706 UCX_FOREACH(elm, obj->children) {
686 ConfigNode *node = elm->data; 707 ConfigNode *node = elm->data;
687 if(!sstrcasecmp(node->name, SC("DavBackend"))) { 708 if(!sstrcasecmp(node->name, SC("DavBackend"))) {
688 if(node->type == CONFIG_NODE_DIRECTIVE) { 709 if(node->type == CONFIG_NODE_DIRECTIVE) {

mercurial