227 PropfindParser* create_propfind_parser(UcxBuffer *response, char *url) { |
227 PropfindParser* create_propfind_parser(UcxBuffer *response, char *url) { |
228 PropfindParser *parser = malloc(sizeof(PropfindParser)); |
228 PropfindParser *parser = malloc(sizeof(PropfindParser)); |
229 if(!parser) { |
229 if(!parser) { |
230 return NULL; |
230 return NULL; |
231 } |
231 } |
232 parser->document = xmlReadMemory(response->space, response->size, url, NULL, 0); |
232 parser->document = xmlReadMemory(response->space, response->pos, url, NULL, 0); |
233 parser->current = NULL; |
233 parser->current = NULL; |
234 if(parser->document) { |
234 if(parser->document) { |
235 xmlNode *xml_root = xmlDocGetRootElement(parser->document); |
235 xmlNode *xml_root = xmlDocGetRootElement(parser->document); |
236 if(xml_root) { |
236 if(xml_root) { |
237 xmlNode *node = xml_root->children; |
237 xmlNode *node = xml_root->children; |
430 &nlen); |
430 &nlen); |
431 name = dav_session_strdup(sn, uname); |
431 name = dav_session_strdup(sn, uname); |
432 curl_free(uname); |
432 curl_free(uname); |
433 } |
433 } |
434 |
434 |
435 char *href = dav_session_strdup(sn, href); |
435 char *href = dav_session_strdup(sn, response->href); |
436 DavResource *res = NULL; |
436 DavResource *res = NULL; |
437 if(parent_path) { |
437 if(parent_path) { |
438 res = dav_resource_new_full(sn, parent_path, name, href); |
438 res = dav_resource_new_full(sn, parent_path, name, href); |
439 } else { |
439 } else { |
440 res = dav_resource_new_href(sn, href); |
440 res = dav_resource_new_href(sn, href); |