Mercurial > hg > nginx
comparison src/http/modules/ngx_http_index_handler.c @ 119:cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 20 Jul 2003 21:15:59 +0000 |
parents | 5bf52498665c |
children | ef8c87afcfc5 |
comparison
equal
deleted
inserted
replaced
118:5bf52498665c | 119:cd54bcbaf3b5 |
---|---|
13 #define NGX_HTTP_DEFAULT_INDEX "index.html" | 13 #define NGX_HTTP_DEFAULT_INDEX "index.html" |
14 | 14 |
15 | 15 |
16 static int ngx_http_index_test_dir(ngx_http_request_t *r); | 16 static int ngx_http_index_test_dir(ngx_http_request_t *r); |
17 static int ngx_http_index_init(ngx_cycle_t *cycle); | 17 static int ngx_http_index_init(ngx_cycle_t *cycle); |
18 static void *ngx_http_index_create_conf(ngx_pool_t *pool); | 18 static void *ngx_http_index_create_conf(ngx_conf_t *cf); |
19 static char *ngx_http_index_merge_conf(ngx_pool_t *p, void *parent, | 19 static char *ngx_http_index_merge_conf(ngx_conf_t *cf, |
20 void *child); | 20 void *parent, void *child); |
21 static char *ngx_http_index_set_index(ngx_conf_t *cf, ngx_command_t *cmd, | 21 static char *ngx_http_index_set_index(ngx_conf_t *cf, ngx_command_t *cmd, |
22 void *conf); | 22 void *conf); |
23 | 23 |
24 | 24 |
25 static ngx_command_t ngx_http_index_commands[] = { | 25 static ngx_command_t ngx_http_index_commands[] = { |
26 | 26 |
27 {ngx_string("index"), | 27 {ngx_string("index"), |
218 | 218 |
219 return NGX_OK; | 219 return NGX_OK; |
220 } | 220 } |
221 | 221 |
222 | 222 |
223 static void *ngx_http_index_create_conf(ngx_pool_t *pool) | 223 static void *ngx_http_index_create_conf(ngx_conf_t *cf) |
224 { | 224 { |
225 ngx_http_index_conf_t *conf; | 225 ngx_http_index_conf_t *conf; |
226 | 226 |
227 ngx_test_null(conf, ngx_palloc(pool, sizeof(ngx_http_index_conf_t)), | 227 ngx_test_null(conf, ngx_palloc(cf->pool, sizeof(ngx_http_index_conf_t)), |
228 NGX_CONF_ERROR); | 228 NGX_CONF_ERROR); |
229 | 229 |
230 ngx_init_array(conf->indices, pool, 3, sizeof(ngx_str_t), NGX_CONF_ERROR); | 230 ngx_init_array(conf->indices, cf->pool, 3, sizeof(ngx_str_t), |
231 NGX_CONF_ERROR); | |
231 conf->max_index_len = 0; | 232 conf->max_index_len = 0; |
232 | 233 |
233 return conf; | 234 return conf; |
234 } | 235 } |
235 | 236 |
236 | 237 |
237 /* TODO: remove duplicate indices */ | 238 /* TODO: remove duplicate indices */ |
238 | 239 |
239 static char *ngx_http_index_merge_conf(ngx_pool_t *p, void *parent, void *child) | 240 static char *ngx_http_index_merge_conf(ngx_conf_t *cf, |
241 void *parent, void *child) | |
240 { | 242 { |
241 ngx_http_index_conf_t *prev = parent; | 243 ngx_http_index_conf_t *prev = parent; |
242 ngx_http_index_conf_t *conf = child; | 244 ngx_http_index_conf_t *conf = child; |
243 | 245 |
244 int i; | 246 int i; |