comparison src/http/modules/ngx_http_index_module.c @ 248:acd2ec3541cb NGINX_0_4_9

nginx 0.4.9 *) Feature: the "set" parameter in the "include" SSI command. *) Feature: the ngx_http_perl_module now tests the nginx.pm module version.
author Igor Sysoev <http://sysoev.ru>
date Fri, 13 Oct 2006 00:00:00 +0400
parents c16038b14e68
children 644510700914
comparison
equal deleted inserted replaced
247:fcca101509a4 248:acd2ec3541cb
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;