libidav/webdav.c

changeset 46
0542668d0f26
parent 45
e3839719b079
child 47
fbbbeed4ba8f
equal deleted inserted replaced
45:e3839719b079 46:0542668d0f26
235 return stack; 235 return stack;
236 } 236 }
237 237
238 DavResource* dav_query_get(DavSession *sn, DavGetQuery *query) { 238 DavResource* dav_query_get(DavSession *sn, DavGetQuery *query) {
239 char *path; 239 char *path;
240 int depth = 0; 240 int depth = query->depth;
241 /* 241 /*
242 if(parse_path_query(query->from, &path, &depth)) { 242 if(parse_path_query(query->from, &path, &depth)) {
243 sn->error = DAV_ERROR; 243 sn->error = DAV_ERROR;
244 return NULL; 244 return NULL;
245 } 245 }
264 free(path); 264 free(path);
265 if(dav_propfind(sn, resource, rqbuf, query->condition, query->condlen)) { 265 if(dav_propfind(sn, resource, rqbuf, query->condition, query->condlen)) {
266 dav_resource_free(resource); 266 dav_resource_free(resource);
267 resource = NULL; 267 resource = NULL;
268 } 268 }
269 ucx_buffer_free(rqbuf);
270 269
271 int error = 0; 270 int error = 0;
272 if(resource && depth == -1) { 271 if(resource && depth == -1) {
273 UcxList *stack = NULL; // stack with DavResource* elements 272 UcxList *stack = NULL; // stack with DavResource* elements
274 stack = propfind_stack_push(stack, resource->children); 273 stack = propfind_stack_push(stack, resource->children);
282 break; 281 break;
283 } 282 }
284 stack = propfind_stack_push(stack, sr->children); // add children 283 stack = propfind_stack_push(stack, sr->children); // add children
285 } 284 }
286 } 285 }
286
287 ucx_buffer_free(rqbuf);
287 return resource; 288 return resource;
288 } 289 }
289 290
290 UcxList* parse_properties_string(DavContext *context, sstr_t str) { 291 UcxList* parse_properties_string(DavContext *context, sstr_t str) {
291 UcxList *proplist = NULL; 292 UcxList *proplist = NULL;

mercurial