comparison src/http/modules/ngx_http_access_module.c @ 230:38e7b94d63ac NGINX_0_4_0

nginx 0.4.0 *) Change in internal API: the HTTP modules initialization was moved from the init module phase to the HTTP postconfiguration phase. *) Change: now the request body is not read beforehand for the ngx_http_perl_module: it's required to start the reading using the $r->has_request_body method. *) Feature: the ngx_http_perl_module supports the DECLINED return code. *) Feature: the ngx_http_dav_module supports the incoming "Date" header line for the PUT method. *) Feature: the "ssi" directive is available inside the "if" block. *) Bugfix: a segmentation fault occurred if there was an "index" directive with variables and the first index name was without variables; bug appeared in 0.1.29.
author Igor Sysoev <http://sysoev.ru>
date Wed, 30 Aug 2006 00:00:00 +0400
parents fa32d59d9a15
children 9fc4ab6673f9
comparison
equal deleted inserted replaced
229:1965c8e23be7 230:38e7b94d63ac
27 static char *ngx_http_access_rule(ngx_conf_t *cf, ngx_command_t *cmd, 27 static char *ngx_http_access_rule(ngx_conf_t *cf, ngx_command_t *cmd,
28 void *conf); 28 void *conf);
29 static void *ngx_http_access_create_loc_conf(ngx_conf_t *cf); 29 static void *ngx_http_access_create_loc_conf(ngx_conf_t *cf);
30 static char *ngx_http_access_merge_loc_conf(ngx_conf_t *cf, 30 static char *ngx_http_access_merge_loc_conf(ngx_conf_t *cf,
31 void *parent, void *child); 31 void *parent, void *child);
32 static ngx_int_t ngx_http_access_init(ngx_cycle_t *cycle); 32 static ngx_int_t ngx_http_access_init(ngx_conf_t *cf);
33 33
34 34
35 static ngx_command_t ngx_http_access_commands[] = { 35 static ngx_command_t ngx_http_access_commands[] = {
36 36
37 { ngx_string("allow"), 37 { ngx_string("allow"),
55 55
56 56
57 57
58 static ngx_http_module_t ngx_http_access_module_ctx = { 58 static ngx_http_module_t ngx_http_access_module_ctx = {
59 NULL, /* preconfiguration */ 59 NULL, /* preconfiguration */
60 NULL, /* postconfiguration */ 60 ngx_http_access_init, /* postconfiguration */
61 61
62 NULL, /* create main configuration */ 62 NULL, /* create main configuration */
63 NULL, /* init main configuration */ 63 NULL, /* init main configuration */
64 64
65 NULL, /* create server configuration */ 65 NULL, /* create server configuration */
74 NGX_MODULE_V1, 74 NGX_MODULE_V1,
75 &ngx_http_access_module_ctx, /* module context */ 75 &ngx_http_access_module_ctx, /* module context */
76 ngx_http_access_commands, /* module directives */ 76 ngx_http_access_commands, /* module directives */
77 NGX_HTTP_MODULE, /* module type */ 77 NGX_HTTP_MODULE, /* module type */
78 NULL, /* init master */ 78 NULL, /* init master */
79 ngx_http_access_init, /* init module */ 79 NULL, /* init module */
80 NULL, /* init process */ 80 NULL, /* init process */
81 NULL, /* init thread */ 81 NULL, /* init thread */
82 NULL, /* exit thread */ 82 NULL, /* exit thread */
83 NULL, /* exit process */ 83 NULL, /* exit process */
84 NULL, /* exit master */ 84 NULL, /* exit master */
213 return NGX_CONF_OK; 213 return NGX_CONF_OK;
214 } 214 }
215 215
216 216
217 static ngx_int_t 217 static ngx_int_t
218 ngx_http_access_init(ngx_cycle_t *cycle) 218 ngx_http_access_init(ngx_conf_t *cf)
219 { 219 {
220 ngx_http_handler_pt *h; 220 ngx_http_handler_pt *h;
221 ngx_http_core_main_conf_t *cmcf; 221 ngx_http_core_main_conf_t *cmcf;
222 222
223 cmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_core_module); 223 cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
224 224
225 h = ngx_array_push(&cmcf->phases[NGX_HTTP_ACCESS_PHASE].handlers); 225 h = ngx_array_push(&cmcf->phases[NGX_HTTP_ACCESS_PHASE].handlers);
226 if (h == NULL) { 226 if (h == NULL) {
227 return NGX_ERROR; 227 return NGX_ERROR;
228 } 228 }