comparison src/http/modules/ngx_http_static_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 003bd800ec2a
children d8f5c91a5c07
comparison
equal deleted inserted replaced
229:1965c8e23be7 230:38e7b94d63ac
16 16
17 static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r); 17 static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r);
18 static void *ngx_http_static_create_loc_conf(ngx_conf_t *cf); 18 static void *ngx_http_static_create_loc_conf(ngx_conf_t *cf);
19 static char *ngx_http_static_merge_loc_conf(ngx_conf_t *cf, 19 static char *ngx_http_static_merge_loc_conf(ngx_conf_t *cf,
20 void *parent, void *child); 20 void *parent, void *child);
21 static ngx_int_t ngx_http_static_init(ngx_cycle_t *cycle); 21 static ngx_int_t ngx_http_static_init(ngx_conf_t *cf);
22 22
23 23
24 static ngx_command_t ngx_http_static_commands[] = { 24 static ngx_command_t ngx_http_static_commands[] = {
25 25
26 #if (NGX_HTTP_CACHE) 26 #if (NGX_HTTP_CACHE)
38 }; 38 };
39 39
40 40
41 ngx_http_module_t ngx_http_static_module_ctx = { 41 ngx_http_module_t ngx_http_static_module_ctx = {
42 NULL, /* preconfiguration */ 42 NULL, /* preconfiguration */
43 NULL, /* postconfiguration */ 43 ngx_http_static_init, /* postconfiguration */
44 44
45 NULL, /* create main configuration */ 45 NULL, /* create main configuration */
46 NULL, /* init main configuration */ 46 NULL, /* init main configuration */
47 47
48 NULL, /* create server configuration */ 48 NULL, /* create server configuration */
57 NGX_MODULE_V1, 57 NGX_MODULE_V1,
58 &ngx_http_static_module_ctx, /* module context */ 58 &ngx_http_static_module_ctx, /* module context */
59 ngx_http_static_commands, /* module directives */ 59 ngx_http_static_commands, /* module directives */
60 NGX_HTTP_MODULE, /* module type */ 60 NGX_HTTP_MODULE, /* module type */
61 NULL, /* init master */ 61 NULL, /* init master */
62 ngx_http_static_init, /* init module */ 62 NULL, /* init module */
63 NULL, /* init process */ 63 NULL, /* init process */
64 NULL, /* init thread */ 64 NULL, /* init thread */
65 NULL, /* exit thread */ 65 NULL, /* exit thread */
66 NULL, /* exit process */ 66 NULL, /* exit process */
67 NULL, /* exit master */ 67 NULL, /* exit master */
315 return NGX_CONF_OK; 315 return NGX_CONF_OK;
316 } 316 }
317 317
318 318
319 static ngx_int_t 319 static ngx_int_t
320 ngx_http_static_init(ngx_cycle_t *cycle) 320 ngx_http_static_init(ngx_conf_t *cf)
321 { 321 {
322 ngx_http_handler_pt *h; 322 ngx_http_handler_pt *h;
323 ngx_http_core_main_conf_t *cmcf; 323 ngx_http_core_main_conf_t *cmcf;
324 324
325 cmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_core_module); 325 cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
326 326
327 h = ngx_array_push(&cmcf->phases[NGX_HTTP_CONTENT_PHASE].handlers); 327 h = ngx_array_push(&cmcf->phases[NGX_HTTP_CONTENT_PHASE].handlers);
328 if (h == NULL) { 328 if (h == NULL) {
329 return NGX_ERROR; 329 return NGX_ERROR;
330 } 330 }