49 DavContext *context = calloc(1, sizeof(DavContext)); |
49 DavContext *context = calloc(1, sizeof(DavContext)); |
50 if(!context) { |
50 if(!context) { |
51 return NULL; |
51 return NULL; |
52 } |
52 } |
53 context->sessions = cxLinkedListCreate(cxDefaultAllocator, cx_cmp_intptr, CX_STORE_POINTERS); |
53 context->sessions = cxLinkedListCreate(cxDefaultAllocator, cx_cmp_intptr, CX_STORE_POINTERS); |
54 context->sessions->destructor_data = dav_session_destructor; |
54 cxDefineDestructor(context->sessions, dav_session_destructor); |
55 context->http_proxy = calloc(1, sizeof(DavProxy)); |
55 context->http_proxy = calloc(1, sizeof(DavProxy)); |
56 if(!context->http_proxy) { |
56 if(!context->http_proxy) { |
57 dav_context_destroy(context); |
57 dav_context_destroy(context); |
58 return NULL; |
58 return NULL; |
59 } |
59 } |
300 // TODO: rewrite using dav_get_property_ns |
300 // TODO: rewrite using dav_get_property_ns |
301 |
301 |
302 char *pname = strchr(prefixed_name, ':'); |
302 char *pname = strchr(prefixed_name, ':'); |
303 char *pns = "DAV:"; |
303 char *pns = "DAV:"; |
304 if(pname) { |
304 if(pname) { |
305 DavNamespace *ns = dav_get_namespace_s( |
305 DavNamespace *davns = dav_get_namespace_s( |
306 ctx, |
306 ctx, |
307 cx_strn(prefixed_name, pname-prefixed_name)); |
307 cx_strn(prefixed_name, pname-prefixed_name)); |
308 if(ns) { |
308 if(davns) { |
309 pns = ns->name; |
309 pns = davns->name; |
310 pname++; |
310 pname++; |
311 } else { |
311 } else { |
312 pns = NULL; |
312 pns = NULL; |
313 pname = NULL; |
313 pname = NULL; |
314 } |
314 } |