Mercurial > hg > nginx
comparison src/http/modules/ngx_http_index_module.c @ 773:c3ebeee31026
remove r->root_length
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 12 Oct 2006 13:36:54 +0000 |
parents | fd8a64f5dd3b |
children | a608349951cf |
comparison
equal
deleted
inserted
replaced
772:843412b22ba2 | 773:c3ebeee31026 |
---|---|
25 typedef struct { | 25 typedef struct { |
26 ngx_uint_t current; | 26 ngx_uint_t current; |
27 | 27 |
28 ngx_str_t path; | 28 ngx_str_t path; |
29 ngx_str_t index; | 29 ngx_str_t index; |
30 | |
31 size_t root; | |
30 | 32 |
31 ngx_uint_t tested; /* unsigned tested:1 */ | 33 ngx_uint_t tested; /* unsigned tested:1 */ |
32 } ngx_http_index_ctx_t; | 34 } ngx_http_index_ctx_t; |
33 | 35 |
34 | 36 |
198 len += 16; | 200 len += 16; |
199 } | 201 } |
200 | 202 |
201 if (len > (size_t) (ctx->path.data + ctx->path.len - ctx->index.data)) { | 203 if (len > (size_t) (ctx->path.data + ctx->path.len - ctx->index.data)) { |
202 | 204 |
203 last = ngx_http_map_uri_to_path(r, &ctx->path, len); | 205 last = ngx_http_map_uri_to_path(r, &ctx->path, &ctx->root, len); |
204 if (last == NULL) { | 206 if (last == NULL) { |
205 return NGX_ERROR; | 207 return NGX_ERROR; |
206 } | 208 } |
207 | 209 |
208 ctx->index.data = last; | 210 ctx->index.data = last; |
289 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | 291 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
290 | 292 |
291 uri.len = r->uri.len + ctx->index.len - 1; | 293 uri.len = r->uri.len + ctx->index.len - 1; |
292 | 294 |
293 if (!clcf->alias) { | 295 if (!clcf->alias) { |
294 uri.data = ctx->path.data + r->root_length; | 296 uri.data = ctx->path.data + ctx->root; |
295 | 297 |
296 } else { | 298 } else { |
297 uri.data = ngx_palloc(r->pool, uri.len); | 299 uri.data = ngx_palloc(r->pool, uri.len); |
298 if (uri.data == NULL) { | 300 if (uri.data == NULL) { |
299 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 301 return NGX_HTTP_INTERNAL_SERVER_ERROR; |