269 } |
269 } |
270 |
270 |
271 // end |
271 // end |
272 cx_bprintf(buf, "</D:prop>\n</D:%s>\n", rootelm); |
272 cx_bprintf(buf, "</D:prop>\n</D:%s>\n", rootelm); |
273 |
273 |
274 cxMapDestroy(namespaces); |
274 cxMapFree(namespaces); |
275 return buf; |
275 return buf; |
276 } |
276 } |
277 |
277 |
278 CxBuffer* create_basic_propfind_request(void) { |
278 CxBuffer* create_basic_propfind_request(void) { |
279 CxBuffer *buf = cxBufferCreate(NULL, 512, cxDefaultAllocator, CX_BUFFER_FREE_CONTENTS|CX_BUFFER_AUTO_EXTEND); |
279 CxBuffer *buf = cxBufferCreate(NULL, 512, cxDefaultAllocator, CX_BUFFER_FREE_CONTENTS|CX_BUFFER_AUTO_EXTEND); |
443 return 1; |
443 return 1; |
444 } |
444 } |
445 |
445 |
446 void cleanup_response(ResponseTag *result) { |
446 void cleanup_response(ResponseTag *result) { |
447 if(result) { |
447 if(result) { |
448 cxListDestroy(result->properties); |
448 cxListFree(result->properties); |
449 } |
449 } |
450 } |
450 } |
451 |
451 |
452 int hrefeq(DavSession *sn, const char *href1, const char *href2) { |
452 int hrefeq(DavSession *sn, const char *href1, const char *href2) { |
453 cxmutstr href_s = cx_mutstr(util_url_decode(sn, href1)); |
453 cxmutstr href_s = cx_mutstr(util_url_decode(sn, href1)); |
731 if(xstreq(prop->name, "crypto-prop")) { |
731 if(xstreq(prop->name, "crypto-prop")) { |
732 crypto_prop = prop; |
732 crypto_prop = prop; |
733 } |
733 } |
734 } |
734 } |
735 } |
735 } |
736 cxListDestroy(properties); |
736 cxListFree(properties); |
737 |
737 |
738 if(crypto_prop && crypto_key) { |
738 if(crypto_prop && crypto_key) { |
739 char *crypto_prop_content = util_xml_get_text(crypto_prop); |
739 char *crypto_prop_content = util_xml_get_text(crypto_prop); |
740 DavKey *key = dav_context_get_key(res->session->context, crypto_key); |
740 DavKey *key = dav_context_get_key(res->session->context, crypto_key); |
741 if(crypto_prop_content && key) { |
741 if(crypto_prop_content && key) { |
947 |
947 |
948 s = CX_STR("</D:propertyupdate>\n"); |
948 s = CX_STR("</D:propertyupdate>\n"); |
949 cxBufferWrite(s.ptr, 1, s.length, buf); |
949 cxBufferWrite(s.ptr, 1, s.length, buf); |
950 |
950 |
951 // cleanup namespace map |
951 // cleanup namespace map |
952 cxMapDestroy(namespaces); |
952 cxMapFree(namespaces); |
953 |
953 |
954 return buf; |
954 return buf; |
955 } |
955 } |
956 |
956 |
957 CxBuffer* create_crypto_proppatch_request(DavSession *sn, DavKey *key, const char *name, const char *hash) { |
957 CxBuffer* create_crypto_proppatch_request(DavSession *sn, DavKey *key, const char *name, const char *hash) { |