+static APR_INLINE void domaintree_fake(apr_pool_t *pool, MOD_DT_CNF *DT, char **path)
+{
+ int more;
+ apr_hash_index_t *idx;
+ size_t recurlevel = 0, plen = strlen(DT->prefix) + 1;
+
+begin:
+ more = 0;
+
+ if (recurlevel++ > DT->aliases.recursion) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_SUCCESS, DT->server, "DomainTree: maximum alias recursion level (%d) exceeded!"
+ " Check if you have recursive definitions of DomainTreeAlias directives.", DT->aliases.recursion);
+ return;
+ }
+
+ for (idx = apr_hash_first(pool, DT->aliases.hashtable); idx; idx = apr_hash_next(idx)) {
+ apr_ssize_t flen;
+ char *fake, *real, *poff;
+
+ poff = *path + plen;
+ apr_hash_this(idx, (const void **) &fake, &flen, (void **) &real);
+
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, DT->server, "DomainTree: fake test %s in %s", fake, poff);
+
+ if ((!strncasecmp(poff, fake, flen)) && ((!poff[flen]) || (poff[flen] == '/'))) {
+ char *padd;
+
+ more = 1;
+ padd = apr_pstrndup(pool, poff + flen + 1, strlen(poff) - flen - 1);
+ *path = apr_pstrcat(pool, DT->prefix, "/", real, "/", padd, NULL);
+
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, DT->server, "DomainTree: fake done %s<>%s = %s", fake, real, *path);
+ }
+ }
+
+ if (more && DT->aliases.recursion) {
+ goto begin;
+ }
+}
+