MCPcopy Create free account
hub / github.com/apache/httpd / dav_get_props

Function dav_get_props

modules/dav/main/props.c:723–927  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

721}
722
723DAV_DECLARE(dav_get_props_result) dav_get_props(dav_propdb *propdb,
724 apr_xml_doc *doc)
725{
726 const dav_hooks_db *db_hooks = propdb->db_hooks;
727 apr_xml_elem *elem = dav_find_child(doc->root, "prop");
728 apr_text_header hdr_good = { 0 };
729 apr_text_header hdr_bad = { 0 };
730 apr_text_header hdr_ns = { 0 };
731 int have_good = 0;
732 dav_get_props_result result = { 0 };
733 dav_liveprop_elem *element;
734 char *marks_liveprop;
735 dav_xmlns_info *xi;
736 int xi_filled = 0;
737
738 /* we lose both the document and the element when calling (insert_prop),
739 * make these available in the pool.
740 */
741 element = dav_get_liveprop_element(propdb->resource);
742 if (!element) {
743 element = apr_pcalloc(propdb->resource->pool, sizeof(dav_liveprop_elem));
744 apr_pool_userdata_setn(element, DAV_PROP_ELEMENT, NULL, propdb->resource->pool);
745 }
746 else {
747 memset(element, 0, sizeof(dav_liveprop_elem));
748 }
749 element->doc = doc;
750
751 /* ### NOTE: we should pass in TWO buffers -- one for keys, one for
752 the marks */
753
754 /* we will ALWAYS provide a "good" result, even if it is EMPTY */
755 apr_text_append(propdb->p, &hdr_good,
756 "<D:propstat>" DEBUG_CR
757 "<D:prop>" DEBUG_CR);
758
759 /* ### the marks should be in a buffer! */
760 /* allocate zeroed-memory for the marks. These marks indicate which
761 liveprop namespaces we've generated into the output xmlns buffer */
762
763 /* same for the liveprops */
764 marks_liveprop = apr_pcalloc(propdb->p, dav_get_liveprop_ns_count() + 1);
765
766 xi = dav_xmlns_create(propdb->p);
767
768 for (elem = elem->first_child; elem; elem = elem->next) {
769 dav_elem_private *priv;
770 dav_error *err;
771 dav_prop_insert inserted;
772 dav_prop_name name;
773
774 element->elem = elem;
775
776 /*
777 ** First try live property providers; if they don't handle
778 ** the property, then try looking it up in the propdb.
779 */
780

Callers 2

dav_propfind_walkerFunction · 0.85
mod_dav.hFile · 0.85

Calls 12

dav_find_childFunction · 0.85
dav_get_liveprop_elementFunction · 0.85
dav_xmlns_createFunction · 0.85
dav_find_livepropFunction · 0.85
dav_insert_livepropFunction · 0.85
dav_insert_xmlnsFunction · 0.85
dav_new_errorFunction · 0.85
dav_really_open_dbFunction · 0.85
dav_output_prop_nameFunction · 0.85
dav_xmlns_generateFunction · 0.85

Tested by

no test coverage detected