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

Function find_item

modules/generators/mod_autoindex.c:761–802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

759};
760
761static char *find_item(const char *content_type, const char *content_encoding,
762 char *path, apr_array_header_t *list, int path_only)
763{
764 struct item *items = (struct item *) list->elts;
765 int i;
766
767 for (i = 0; i < list->nelts; ++i) {
768 struct item *p = &items[i];
769
770 /* Special cased for ^^DIRECTORY^^ and ^^BLANKICON^^ */
771 if ((path[0] == '^') || (!ap_strcmp_match(path, p->apply_path))) {
772 if (!*(p->apply_to)) {
773 return p->data;
774 }
775 else if (p->type == BY_PATH || path[0] == '^') {
776 if (!ap_strcmp_match(path, p->apply_to)) {
777 return p->data;
778 }
779 }
780 else if (!path_only) {
781 if (!content_encoding) {
782 if (p->type == BY_TYPE) {
783 if (content_type
784 && !ap_strcasecmp_match(content_type,
785 p->apply_to)) {
786 return p->data;
787 }
788 }
789 }
790 else {
791 if (p->type == BY_ENCODING) {
792 if (!ap_strcasecmp_match(content_encoding,
793 p->apply_to)) {
794 return p->data;
795 }
796 }
797 }
798 }
799 }
800 }
801 return NULL;
802}
803
804static char *find_item_by_request(request_rec *r, apr_array_header_t *list, int path_only)
805{

Callers 1

find_item_by_requestFunction · 0.85

Calls 2

ap_strcmp_matchFunction · 0.85
ap_strcasecmp_matchFunction · 0.85

Tested by

no test coverage detected