620 result.result = selroot; |
620 result.result = selroot; |
621 result.status = 0; |
621 result.status = 0; |
622 |
622 |
623 // do a propfind request for each resource on the stack |
623 // do a propfind request for each resource on the stack |
624 while(stack->size > 0) { |
624 while(stack->size > 0) { |
625 DavQLRes *sr = cxListAt(stack, 0); // get first element from the stack |
625 DavQLRes *sr_ptr = cxListAt(stack, 0); // get first element from the stack |
626 cxListRemove(stack, 0); |
626 DavResource *root = sr_ptr->resource; |
|
627 int res_depth = sr_ptr->depth; |
627 cxListRemove(stack, 0); // remove first element |
628 cxListRemove(stack, 0); // remove first element |
628 DavResource *root = sr->resource; |
|
629 |
629 |
630 util_set_url(sn, dav_resource_get_href(sr->resource)); |
630 util_set_url(sn, dav_resource_get_href(root)); |
631 CURLcode ret = do_propfind_request(sn, rqbuf, rpbuf); |
631 CURLcode ret = do_propfind_request(sn, rqbuf, rpbuf); |
632 long http_status = 0; |
632 long http_status = 0; |
633 curl_easy_getinfo(sn->handle, CURLINFO_RESPONSE_CODE, &http_status); |
633 curl_easy_getinfo(sn->handle, CURLINFO_RESPONSE_CODE, &http_status); |
634 //printf("rpbuf: %s %s\n%.*s\n\n", sr->resource->path, sr->resource->href, rpbuf->pos, rpbuf->space); |
634 //printf("rpbuf: %s %s\n%.*s\n\n", sr->resource->path, sr->resource->href, rpbuf->pos, rpbuf->space); |
635 |
635 |
700 if(where_result.data.integer != 0) { |
700 if(where_result.data.integer != 0) { |
701 if(!reset_properties(sn, &result, child, cfieldlist)) { |
701 if(!reset_properties(sn, &result, child, cfieldlist)) { |
702 //resource_add_child(root, child); |
702 //resource_add_child(root, child); |
703 resource_add_ordered_child(root, child, ordercr); |
703 resource_add_ordered_child(root, child, ordercr); |
704 if(child->iscollection && |
704 if(child->iscollection && |
705 (depth < 0 || depth > sr->depth+1)) |
705 (depth < 0 || depth > res_depth+1)) |
706 { |
706 { |
707 DavQLRes rs; |
707 DavQLRes rs; |
708 rs.resource = child; |
708 rs.resource = child; |
709 rs.depth = sr->depth + 1; |
709 rs.depth = res_depth + 1; |
710 cxListInsert(stack, 0, &rs); |
710 cxListInsert(stack, 0, &rs); |
711 } |
711 } |
712 } else { |
712 } else { |
713 dav_resource_free(child); |
713 dav_resource_free(child); |
714 } |
714 } |