| 169 | } |
| 170 | |
| 171 | static int fixup_dflt(request_rec *r) |
| 172 | { |
| 173 | dir_config_rec *d = ap_get_module_config(r->per_dir_config, &dir_module); |
| 174 | const char *name_ptr; |
| 175 | request_rec *rr; |
| 176 | int error_notfound = 0; |
| 177 | |
| 178 | name_ptr = d->dflt; |
| 179 | if ((name_ptr == NULL) || !(strcasecmp(name_ptr,"disabled"))){ |
| 180 | return DECLINED; |
| 181 | } |
| 182 | /* XXX: if FallbackResource points to something that doesn't exist, |
| 183 | * this may recurse until it hits the limit for internal redirects |
| 184 | * before returning an Internal Server Error. |
| 185 | */ |
| 186 | |
| 187 | /* The logic of this function is basically cloned and simplified |
| 188 | * from fixup_dir below. See the comments there. |
| 189 | */ |
| 190 | if (r->args != NULL) { |
| 191 | name_ptr = apr_pstrcat(r->pool, name_ptr, "?", r->args, NULL); |
| 192 | } |
| 193 | rr = ap_sub_req_lookup_uri(name_ptr, r, r->output_filters); |
| 194 | if (rr->status == HTTP_OK |
| 195 | && ( (rr->handler && !strcmp(rr->handler, "proxy-server")) |
| 196 | || rr->finfo.filetype == APR_REG)) { |
| 197 | ap_internal_fast_redirect(rr, r); |
| 198 | return OK; |
| 199 | } |
| 200 | else if (ap_is_HTTP_REDIRECT(rr->status)) { |
| 201 | |
| 202 | apr_pool_join(r->pool, rr->pool); |
| 203 | r->notes = apr_table_overlay(r->pool, r->notes, rr->notes); |
| 204 | r->headers_out = apr_table_overlay(r->pool, r->headers_out, |
| 205 | rr->headers_out); |
| 206 | r->err_headers_out = apr_table_overlay(r->pool, r->err_headers_out, |
| 207 | rr->err_headers_out); |
| 208 | error_notfound = rr->status; |
| 209 | } |
| 210 | else if (rr->status && rr->status != HTTP_NOT_FOUND |
| 211 | && rr->status != HTTP_OK) { |
| 212 | error_notfound = rr->status; |
| 213 | } |
| 214 | |
| 215 | ap_destroy_sub_req(rr); |
| 216 | if (error_notfound) { |
| 217 | return error_notfound; |
| 218 | } |
| 219 | |
| 220 | /* nothing for us to do, pass on through */ |
| 221 | return DECLINED; |
| 222 | } |
| 223 | |
| 224 | static int fixup_dir(request_rec *r) |
| 225 | { |
no test coverage detected