comparison src/http/modules/ngx_http_ssi_filter_module.c @ 126:df17fbafec8f NGINX_0_3_10

nginx 0.3.10 *) Change: the "valid_referers" directive and the "$invalid_referer" variable were moved to the new ngx_http_referer_module from the ngx_http_rewrite_module. *) Change: the "$apache_bytes_sent" variable name was changed to "$body_bytes_sent". *) Feature: the "$sent_http_..." variables. *) Feature: the "if" directive supports the "=" and "!=" operations. *) Feature: the "proxy_pass" directive supports the HTTPS protocol. *) Feature: the "proxy_set_body" directive. *) Feature: the "post_action" directive. *) Feature: the ngx_http_empty_gif_module. *) Feature: the "worker_cpu_affinity" directive for Linux. *) Bugfix: the "rewrite" directive did not unescape URI part in redirect, now it is unescaped except the %00-%25 and %7F-%FF characters. *) Bugfix: nginx could not be built by the icc 9.0 compiler. *) Bugfix: if the SSI was enabled for zero size static file, then the chunked response was encoded incorrectly.
author Igor Sysoev <http://sysoev.ru>
date Tue, 15 Nov 2005 00:00:00 +0300
parents d25a1d6034f1
children 91372f004adf
comparison
equal deleted inserted replaced
125:97504de1f89e 126:df17fbafec8f
195 195
196 ngx_null_command 196 ngx_null_command
197 }; 197 };
198 198
199 199
200 200
201 static ngx_http_module_t ngx_http_ssi_filter_module_ctx = { 201 static ngx_http_module_t ngx_http_ssi_filter_module_ctx = {
202 ngx_http_ssi_add_variables, /* preconfiguration */ 202 ngx_http_ssi_add_variables, /* preconfiguration */
203 NULL, /* postconfiguration */ 203 NULL, /* postconfiguration */
204 204
205 NULL, /* create main configuration */ 205 NULL, /* create main configuration */
208 NULL, /* create server configuration */ 208 NULL, /* create server configuration */
209 NULL, /* merge server configuration */ 209 NULL, /* merge server configuration */
210 210
211 ngx_http_ssi_create_conf, /* create location configuration */ 211 ngx_http_ssi_create_conf, /* create location configuration */
212 ngx_http_ssi_merge_conf /* merge location configuration */ 212 ngx_http_ssi_merge_conf /* merge location configuration */
213 }; 213 };
214 214
215 215
216 ngx_module_t ngx_http_ssi_filter_module = { 216 ngx_module_t ngx_http_ssi_filter_module = {
217 NGX_MODULE_V1, 217 NGX_MODULE_V1,
218 &ngx_http_ssi_filter_module_ctx, /* module context */ 218 &ngx_http_ssi_filter_module_ctx, /* module context */
329 ngx_http_ssi_conf_t *conf; 329 ngx_http_ssi_conf_t *conf;
330 330
331 conf = ngx_http_get_module_loc_conf(r, ngx_http_ssi_filter_module); 331 conf = ngx_http_get_module_loc_conf(r, ngx_http_ssi_filter_module);
332 332
333 if (!conf->enable 333 if (!conf->enable
334 || r->headers_out.content_type.len == 0) 334 || r->headers_out.content_type.len == 0
335 || r->headers_out.content_length_n == 0)
335 { 336 {
336 return ngx_http_next_header_filter(r); 337 return ngx_http_next_header_filter(r);
337 } 338 }
338 339
339 340
379 "[an error occurred while processing the directive]"; 380 "[an error occurred while processing the directive]";
380 381
381 r->filter_need_in_memory = 1; 382 r->filter_need_in_memory = 1;
382 383
383 if (r->main == r) { 384 if (r->main == r) {
384 r->headers_out.content_length_n = -1; 385 ngx_http_clear_content_length(r);
385 if (r->headers_out.content_length) { 386 ngx_http_clear_last_modified(r);
386 r->headers_out.content_length->hash = 0;
387 r->headers_out.content_length = NULL;
388 }
389
390 r->headers_out.last_modified_time = -1;
391 if (r->headers_out.last_modified) {
392 r->headers_out.last_modified->hash = 0;
393 r->headers_out.last_modified = NULL;
394 }
395 } 387 }
396 388
397 return ngx_http_next_header_filter(r); 389 return ngx_http_next_header_filter(r);
398 } 390 }
399 391
1483 "the closing bracket in \"%V\" " 1475 "the closing bracket in \"%V\" "
1484 "variable is missing", &var); 1476 "variable is missing", &var);
1485 return NGX_ERROR; 1477 return NGX_ERROR;
1486 } 1478 }
1487 1479
1488 if (var.len == 0) { 1480 if (var.len == 0) {
1489 goto invalid_variable; 1481 goto invalid_variable;
1490 } 1482 }
1491 1483
1492 for (j = 0; j < var.len; j++) { 1484 for (j = 0; j < var.len; j++) {
1493 var.data[j] = ngx_tolower(var.data[j]); 1485 var.data[j] = ngx_tolower(var.data[j]);
1981 ngx_http_ssi_ctx_t *ctx; 1973 ngx_http_ssi_ctx_t *ctx;
1982 ngx_time_t *tp; 1974 ngx_time_t *tp;
1983 struct tm tm; 1975 struct tm tm;
1984 char buf[NGX_HTTP_SSI_DATE_LEN]; 1976 char buf[NGX_HTTP_SSI_DATE_LEN];
1985 1977
1986 v->valid = 1; 1978 v->valid = 1;
1987 v->no_cachable = 0; 1979 v->no_cachable = 0;
1988 v->not_found = 0; 1980 v->not_found = 0;
1989 1981
1990 tp = ngx_timeofday(); 1982 tp = ngx_timeofday();
1991 1983
2090 2082
2091 var->handler = v->handler; 2083 var->handler = v->handler;
2092 var->data = v->data; 2084 var->data = v->data;
2093 } 2085 }
2094 2086
2095 return NGX_OK; 2087 return NGX_OK;
2096 } 2088 }
2097 2089
2098 2090
2099 static void * 2091 static void *
2100 ngx_http_ssi_create_conf(ngx_conf_t *cf) 2092 ngx_http_ssi_create_conf(ngx_conf_t *cf)