| 759 | }; |
| 760 | |
| 761 | static 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 | |
| 804 | static char *find_item_by_request(request_rec *r, apr_array_header_t *list, int path_only) |
| 805 | { |
no test coverage detected