remove r->root_length
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 0cc9c7f..9dc2069 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -794,6 +794,7 @@
ngx_http_core_content_phase(ngx_http_request_t *r,
ngx_http_phase_handler_t *ph)
{
+ size_t root;
ngx_int_t rc;
ngx_str_t path;
@@ -830,7 +831,7 @@
if (r->uri.data[r->uri.len - 1] == '/' && !r->zero_in_uri) {
- if (ngx_http_map_uri_to_path(r, &path, 0) != NULL) {
+ if (ngx_http_map_uri_to_path(r, &path, &root, 0) != NULL) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"directory index of \"%V\" is forbidden", &path);
}
@@ -1157,7 +1158,7 @@
u_char *
ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *path,
- size_t reserved)
+ size_t *root_length, size_t reserved)
{
u_char *last;
size_t alias;
@@ -1178,7 +1179,7 @@
if (clcf->root_lengths == NULL) {
- r->root_length = clcf->root.len;
+ *root_length = clcf->root.len;
path->len = clcf->root.len + reserved;
@@ -1201,8 +1202,8 @@
return NULL;
}
- r->root_length = path->len - reserved;
- last = path->data + r->root_length;
+ *root_length = path->len - reserved;
+ last = path->data + *root_length;
}
last = ngx_cpystrn(last, r->uri.data + alias, r->uri.len - alias + 1);