src/server/webdav/webdav.c

changeset 87
bdec069d2239
parent 85
b62e77d8e80c
child 88
73b3485e96f1
--- a/src/server/webdav/webdav.c	Tue Jul 09 20:56:01 2013 +0200
+++ b/src/server/webdav/webdav.c	Thu Jul 11 14:21:23 2013 +0200
@@ -252,6 +252,10 @@
      * get requested properties and initialize some stuff
      */
     DavCollection *collection = rq->davCollection;
+    if(!collection) {
+        collection = pool_malloc(sn->pool, sizeof(DavCollection));
+        collection->mgr = ucx_map_cstr_get(pmgr_map, "default");
+    }
     
     PropfindRequest *davrq = dav_parse_propfind2(sn, rq, xml_body, xml_len);  
     davrq->sn = sn;
@@ -390,6 +394,10 @@
      * parse the xml request and create the proppatch object
      */
     DavCollection *collection = rq->davCollection;
+    if(!collection) {
+        collection = pool_malloc(sn->pool, sizeof(DavCollection));
+        collection->mgr = ucx_map_cstr_get(pmgr_map, "default");
+    }
     
     ProppatchRequest *davrq = dav_parse_proppatch(sn, rq, xml_body, xml_len);
     davrq->sn = sn;
@@ -668,6 +676,10 @@
 }
 
 XmlNs* xmlnsmap_put(XmlNsMap *map, char *ns) {
+    if(!ns) {
+        return NULL;
+    }
+    
     XmlNs *xmlns = xmlnsmap_get(map, ns);
     if(xmlns != NULL) {
         return xmlns;

mercurial