ngx_http_set_exten() is always successful since 0.3.46

This commit is contained in:
Igor Sysoev 2009-07-14 08:38:28 +00:00
parent 0f9733506d
commit b48093291a
3 changed files with 9 additions and 21 deletions

View file

@ -1228,10 +1228,7 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r,
ngx_memcpy(p, name, path.len);
}
if (ngx_http_set_exten(r) != NGX_OK) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
return NGX_OK;
}
ngx_http_set_exten(r);
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"try file uri: \"%V\"", &r->uri);
@ -1641,7 +1638,7 @@ ngx_http_set_content_type(ngx_http_request_t *r)
}
ngx_int_t
void
ngx_http_set_exten(ngx_http_request_t *r)
{
ngx_int_t i;
@ -1655,14 +1652,14 @@ ngx_http_set_exten(ngx_http_request_t *r)
r->exten.len = r->uri.len - i - 1;
r->exten.data = &r->uri.data[i + 1];
break;
return;
} else if (r->uri.data[i] == '/') {
break;
return;
}
}
return NGX_OK;
return;
}
@ -2087,9 +2084,7 @@ ngx_http_subrequest(ngx_http_request_t *r,
sr->method_name = ngx_http_core_get_method;
sr->http_protocol = r->http_protocol;
if (ngx_http_set_exten(sr) != NGX_OK) {
return NGX_ERROR;
}
ngx_http_set_exten(sr);
sr->main = r->main;
sr->parent = r;
@ -2168,10 +2163,7 @@ ngx_http_internal_redirect(ngx_http_request_t *r,
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"internal redirect: \"%V?%V\"", uri, &r->args);
if (ngx_http_set_exten(r) != NGX_OK) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
return NGX_DONE;
}
ngx_http_set_exten(r);
/* clear the modules contexts */
ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);

View file

@ -438,7 +438,7 @@ ngx_int_t ngx_http_core_content_phase(ngx_http_request_t *r,
void *ngx_http_test_content_type(ngx_http_request_t *r, ngx_hash_t *types_hash);
ngx_int_t ngx_http_set_content_type(ngx_http_request_t *r);
ngx_int_t ngx_http_set_exten(ngx_http_request_t *r);
void ngx_http_set_exten(ngx_http_request_t *r);
u_char *ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *name,
size_t *root_length, size_t reserved);
ngx_int_t ngx_http_auth_basic_user(ngx_http_request_t *r);

View file

@ -1074,11 +1074,7 @@ ngx_http_script_regex_end_code(ngx_http_script_engine_t *e)
return;
}
if (ngx_http_set_exten(r) != NGX_OK) {
e->ip = ngx_http_script_exit;
e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
return;
}
ngx_http_set_exten(r);
}
e->ip += sizeof(ngx_http_script_regex_end_code_t);