* Taken from ap_strcmp_match() : * Match = 0, NoMatch = 1, Abort = -1, Inval = -2 * Based loosely on sections of wildmat.c by Rich Salz * Hmmm... shouldn't this really go component by component? * * Adds handling of the "\ " => " " unescaping. */
| 1805 | * Adds handling of the "\<any>" => "<any>" unescaping. |
| 1806 | */ |
| 1807 | static int ap_proxy_strcmp_ematch(const char *str, const char *expected) |
| 1808 | { |
| 1809 | apr_size_t x, y; |
| 1810 | |
| 1811 | for (x = 0, y = 0; expected[y]; ++y, ++x) { |
| 1812 | if (expected[y] == '$' && apr_isdigit(expected[y + 1])) { |
| 1813 | do { |
| 1814 | y += 2; |
| 1815 | } while (expected[y] == '$' && apr_isdigit(expected[y + 1])); |
| 1816 | if (!expected[y]) |
| 1817 | return 0; |
| 1818 | while (str[x]) { |
| 1819 | int ret; |
| 1820 | if ((ret = ap_proxy_strcmp_ematch(&str[x++], &expected[y])) != 1) |
| 1821 | return ret; |
| 1822 | } |
| 1823 | return -1; |
| 1824 | } |
| 1825 | else if (!str[x]) { |
| 1826 | return -1; |
| 1827 | } |
| 1828 | else if (expected[y] == '\\' && !expected[++y]) { |
| 1829 | /* NUL is an invalid char! */ |
| 1830 | return -2; |
| 1831 | } |
| 1832 | if (str[x] != expected[y]) |
| 1833 | return 1; |
| 1834 | } |
| 1835 | /* We got all the way through the worker path without a difference */ |
| 1836 | return 0; |
| 1837 | } |
| 1838 | |
| 1839 | static int worker_matches(proxy_worker *worker, |
| 1840 | const char *url, apr_size_t url_len, |