src/server/webdav/webdav.c

changeset 87
bdec069d2239
parent 85
b62e77d8e80c
child 88
73b3485e96f1
equal deleted inserted replaced
86:49bb6c8ceb2b 87:bdec069d2239
250 250
251 /* 251 /*
252 * get requested properties and initialize some stuff 252 * get requested properties and initialize some stuff
253 */ 253 */
254 DavCollection *collection = rq->davCollection; 254 DavCollection *collection = rq->davCollection;
255 if(!collection) {
256 collection = pool_malloc(sn->pool, sizeof(DavCollection));
257 collection->mgr = ucx_map_cstr_get(pmgr_map, "default");
258 }
255 259
256 PropfindRequest *davrq = dav_parse_propfind2(sn, rq, xml_body, xml_len); 260 PropfindRequest *davrq = dav_parse_propfind2(sn, rq, xml_body, xml_len);
257 davrq->sn = sn; 261 davrq->sn = sn;
258 davrq->rq = rq; 262 davrq->rq = rq;
259 davrq->out = sbuf_new(512); 263 davrq->out = sbuf_new(512);
388 392
389 /* 393 /*
390 * parse the xml request and create the proppatch object 394 * parse the xml request and create the proppatch object
391 */ 395 */
392 DavCollection *collection = rq->davCollection; 396 DavCollection *collection = rq->davCollection;
397 if(!collection) {
398 collection = pool_malloc(sn->pool, sizeof(DavCollection));
399 collection->mgr = ucx_map_cstr_get(pmgr_map, "default");
400 }
393 401
394 ProppatchRequest *davrq = dav_parse_proppatch(sn, rq, xml_body, xml_len); 402 ProppatchRequest *davrq = dav_parse_proppatch(sn, rq, xml_body, xml_len);
395 davrq->sn = sn; 403 davrq->sn = sn;
396 davrq->rq = rq; 404 davrq->rq = rq;
397 davrq->out = sbuf_new(512); 405 davrq->out = sbuf_new(512);
666 void xmlnsmap_free(XmlNsMap *map) { 674 void xmlnsmap_free(XmlNsMap *map) {
667 ucx_map_free(map->map); 675 ucx_map_free(map->map);
668 } 676 }
669 677
670 XmlNs* xmlnsmap_put(XmlNsMap *map, char *ns) { 678 XmlNs* xmlnsmap_put(XmlNsMap *map, char *ns) {
679 if(!ns) {
680 return NULL;
681 }
682
671 XmlNs *xmlns = xmlnsmap_get(map, ns); 683 XmlNs *xmlns = xmlnsmap_get(map, ns);
672 if(xmlns != NULL) { 684 if(xmlns != NULL) {
673 return xmlns; 685 return xmlns;
674 } 686 }
675 687

mercurial