561 return 1; |
561 return 1; |
562 } |
562 } |
563 //char *href = (char*)href_node->content; |
563 //char *href = (char*)href_node->content; |
564 href = util_url_path((char*)href_node->content); |
564 href = util_url_path((char*)href_node->content); |
565 |
565 |
566 sstr_t href_s = sstr(util_url_decode(resource->session, href)); |
566 char *href_s = util_url_decode(resource->session, href); |
567 sstr_t href_r = sstr(util_url_decode(resource->session, resource->href)); |
567 char *href_r = util_url_decode(resource->session, resource->href); |
568 if(!sstrcmp(href_s, href_r)) { |
568 |
|
569 if(hrefeq(sn, href_s, href_r)) { |
569 res = resource; |
570 res = resource; |
570 } else if(href_s.length == href_r.length + 1) { |
571 } |
571 if(href_s.ptr[href_s.length-1] == '/') { |
|
572 href_s.length--; |
|
573 if(!sstrcmp(href_s, href_r)) { |
|
574 res = resource; |
|
575 } |
|
576 } |
|
577 } |
|
578 |
572 |
579 free(href_s.ptr); |
573 free(href_s); |
580 free(href_r.ptr); |
574 free(href_r); |
581 } else if(xstreq(node->name, "propstat")) { |
575 } else if(xstreq(node->name, "propstat")) { |
582 xmlNode *n = node->children; |
576 xmlNode *n = node->children; |
583 xmlNode *prop_node = NULL; |
577 xmlNode *prop_node = NULL; |
584 int ok = 0; |
578 int ok = 0; |
585 // get the status code |
579 // get the status code |