Mercurial > hg > nginx
comparison src/http/modules/ngx_http_index_handler.c @ 110:152567c11325
nginx-0.0.1-2003-07-02-22:51:41 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 02 Jul 2003 18:51:41 +0000 |
parents | 6dfda4cf5200 |
children | d7f606e25b99 |
comparison
equal
deleted
inserted
replaced
109:a9bc21d63fe4 | 110:152567c11325 |
---|---|
12 | 12 |
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_pool_t *pool); | 17 static int ngx_http_index_init(ngx_cycle_t *cycle, ngx_log_t *log); |
18 static void *ngx_http_index_create_conf(ngx_pool_t *pool); | 18 static void *ngx_http_index_create_conf(ngx_pool_t *pool); |
19 static char *ngx_http_index_merge_conf(ngx_pool_t *p, void *parent, | 19 static char *ngx_http_index_merge_conf(ngx_pool_t *p, void *parent, |
20 void *child); | 20 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); |
50 ngx_module_t ngx_http_index_module = { | 50 ngx_module_t ngx_http_index_module = { |
51 NGX_MODULE, | 51 NGX_MODULE, |
52 &ngx_http_index_module_ctx, /* module context */ | 52 &ngx_http_index_module_ctx, /* module context */ |
53 ngx_http_index_commands, /* module directives */ | 53 ngx_http_index_commands, /* module directives */ |
54 NGX_HTTP_MODULE, /* module type */ | 54 NGX_HTTP_MODULE, /* module type */ |
55 ngx_http_index_init /* init module */ | 55 ngx_http_index_init, /* init module */ |
56 NULL, /* commit module */ | |
57 NULL /* rollback module */ | |
56 }; | 58 }; |
57 | 59 |
58 | 60 |
59 /* | 61 /* |
60 Try to open the first index file before the directory existence test | 62 Try to open the first index file before the directory existence test |
200 return NGX_HTTP_NOT_FOUND; | 202 return NGX_HTTP_NOT_FOUND; |
201 } | 203 } |
202 } | 204 } |
203 | 205 |
204 | 206 |
205 static int ngx_http_index_init(ngx_pool_t *pool) | 207 static int ngx_http_index_init(ngx_cycle_t *cycle, ngx_log_t *log) |
206 { | 208 { |
207 ngx_http_handler_pt *h; | 209 ngx_http_handler_pt *h; |
208 | 210 ngx_http_conf_ctx_t *ctx; |
209 ngx_test_null(h, ngx_push_array(&ngx_http_index_handlers), NGX_ERROR); | 211 ngx_http_core_main_conf_t *cmcf; |
212 | |
213 ctx = (ngx_http_conf_ctx_t *) cycle->conf_ctx[ngx_http_module.index]; | |
214 cmcf = ctx->main_conf[ngx_http_core_module.ctx_index]; | |
215 | |
216 ngx_test_null(h, ngx_push_array(&cmcf->index_handlers), NGX_ERROR); | |
210 | 217 |
211 *h = ngx_http_index_handler; | 218 *h = ngx_http_index_handler; |
212 | 219 |
213 return NGX_OK; | 220 return NGX_OK; |
214 } | 221 } |