278 return 1; |
278 return 1; |
279 } |
279 } |
280 //char *href = (char*)href_node->content; |
280 //char *href = (char*)href_node->content; |
281 href = util_url_path((char*)href_node->content); |
281 href = util_url_path((char*)href_node->content); |
282 |
282 |
283 sstr_t href_s = sstr((char*)href); |
283 sstr_t href_s = sstr(util_url_decode(resource->session, href)); |
284 sstr_t href_r = sstr(resource->href); |
284 sstr_t href_r = sstr(util_url_decode(resource->session, resource->href)); |
285 if(!sstrcmp(href_s, href_r)) { |
285 if(!sstrcmp(href_s, href_r)) { |
286 res = resource; |
286 res = resource; |
287 } else if(href_s.length == href_r.length + 1) { |
287 } else if(href_s.length == href_r.length + 1) { |
288 if(href_s.ptr[href_s.length-1] == '/') { |
288 if(href_s.ptr[href_s.length-1] == '/') { |
289 href_s.length--; |
289 href_s.length--; |
290 if(!sstrcmp(href_s, href_r)) { |
290 if(!sstrcmp(href_s, href_r)) { |
291 res = resource; |
291 res = resource; |
292 } |
292 } |
293 } |
293 } |
294 } |
294 } |
|
295 |
|
296 free(href_s.ptr); |
|
297 free(href_r.ptr); |
295 } else if(xstreq(node->name, "propstat")) { |
298 } else if(xstreq(node->name, "propstat")) { |
296 xmlNode *n = node->children; |
299 xmlNode *n = node->children; |
297 xmlNode *prop_node = NULL; |
300 xmlNode *prop_node = NULL; |
298 int ok = 0; |
301 int ok = 0; |
299 // get the status code |
302 // get the status code |