comparison src/http/modules/ngx_http_ssi_filter_module.c @ 546:e19e5f542878 NGINX_0_8_25

nginx 0.8.25 *) Change: now no message is written in an error log if a variable is not found by $r->variable() method. *) Feature: the ngx_http_degradation_module. *) Feature: regular expression named captures. *) Feature: now URI part is not required a "proxy_pass" directive if variables are used. *) Feature: now the "msie_padding" directive works for Chrome too. *) Bugfix: a segmentation fault occurred in a worker process on low memory condition; the bug had appeared in 0.8.18. *) Bugfix: nginx sent gzipped responses to clients those do not support gzip, if "gzip_static on" and "gzip_vary off"; the bug had appeared in 0.8.16.
author Igor Sysoev <http://sysoev.ru>
date Mon, 16 Nov 2009 00:00:00 +0300
parents 4c5d2c627a6c
children 5c576ea5dbd9
comparison
equal deleted inserted replaced
545:91e4b06e1a01 546:e19e5f542878
2448 rc = ngx_strncmp(left.data, right.data, right.len); 2448 rc = ngx_strncmp(left.data, right.data, right.len);
2449 } 2449 }
2450 2450
2451 } else { 2451 } else {
2452 #if (NGX_PCRE) 2452 #if (NGX_PCRE)
2453 ngx_str_t err; 2453 ngx_regex_compile_t rgc;
2454 ngx_regex_t *regex; 2454 u_char errstr[NGX_MAX_CONF_ERRSTR];
2455 u_char errstr[NGX_MAX_CONF_ERRSTR];
2456
2457 err.len = NGX_MAX_CONF_ERRSTR;
2458 err.data = errstr;
2459 2455
2460 right.data[right.len] = '\0'; 2456 right.data[right.len] = '\0';
2461 2457
2462 regex = ngx_regex_compile(&right, 0, r->pool, &err); 2458 ngx_memzero(&rgc, sizeof(ngx_regex_compile_t));
2463 2459
2464 if (regex == NULL) { 2460 rgc.pattern = right;
2465 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "%s", err.data); 2461 rgc.pool = r->pool;
2462 rgc.err.len = NGX_MAX_CONF_ERRSTR;
2463 rgc.err.data = errstr;
2464
2465 if (ngx_regex_compile(&rgc) != NGX_OK) {
2466 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "%V", &rgc.err);
2466 return NGX_HTTP_SSI_ERROR; 2467 return NGX_HTTP_SSI_ERROR;
2467 } 2468 }
2468 2469
2469 rc = ngx_regex_exec(regex, &left, NULL, 0); 2470 rc = ngx_regex_exec(rgc.regex, &left, NULL, 0);
2470 2471
2471 if (rc != NGX_REGEX_NO_MATCHED && rc < 0) { 2472 if (rc < NGX_REGEX_NO_MATCHED) {
2472 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, 2473 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
2473 ngx_regex_exec_n " failed: %d on \"%V\" using \"%V\"", 2474 ngx_regex_exec_n " failed: %i on \"%V\" using \"%V\"",
2474 rc, &left, &right); 2475 rc, &left, &right);
2475 return NGX_HTTP_SSI_ERROR; 2476 return NGX_HTTP_SSI_ERROR;
2476 } 2477 }
2477 #else 2478 #else
2478 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, 2479 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,