comparison src/http/ngx_http_file_cache.c @ 572:ff463db0be31 NGINX_0_8_38

nginx 0.8.38 *) Feature: the "proxy_no_cache" and "fastcgi_no_cache" directives. *) Feature: now the "rewrite" directive does a redirect automatically if the $scheme variable is used. Thanks to Piotr Sikora. *) Bugfix: now "limit_req" delay directive conforms to the described algorithm. Thanks to Maxim Dounin. *) Bugfix: the $uid_got variable might not be used in the SSI and perl modules.
author Igor Sysoev <http://sysoev.ru>
date Mon, 24 May 2010 00:00:00 +0400
parents be4f34123024
children b6a5942a4e6a
comparison
equal deleted inserted replaced
571:5b59e716792b 572:ff463db0be31
1690 v->valid = valid; 1690 v->valid = valid;
1691 } 1691 }
1692 1692
1693 return NGX_CONF_OK; 1693 return NGX_CONF_OK;
1694 } 1694 }
1695
1696
1697 ngx_int_t
1698 ngx_http_cache(ngx_http_request_t *r, ngx_array_t *no_cache)
1699 {
1700 ngx_str_t val;
1701 ngx_uint_t i;
1702 ngx_http_complex_value_t *cv;
1703
1704 cv = no_cache->elts;
1705
1706 for (i = 0; i < no_cache->nelts; i++) {
1707 if (ngx_http_complex_value(r, &cv[i], &val) != NGX_OK) {
1708 return NGX_ERROR;
1709 }
1710
1711 if (val.len && val.data[0] != '0') {
1712 return NGX_DECLINED;
1713 }
1714 }
1715
1716 return NGX_OK;
1717 }
1718
1719
1720 char *
1721 ngx_http_no_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1722 {
1723 char *p = conf;
1724
1725 ngx_str_t *value;
1726 ngx_uint_t i;
1727 ngx_array_t **a;
1728 ngx_http_complex_value_t *cv;
1729 ngx_http_compile_complex_value_t ccv;
1730
1731 a = (ngx_array_t **) (p + cmd->offset);
1732
1733 if (*a == NGX_CONF_UNSET_PTR) {
1734 *a = ngx_array_create(cf->pool, 1, sizeof(ngx_http_complex_value_t));
1735 if (*a == NULL) {
1736 return NGX_CONF_ERROR;
1737 }
1738 }
1739
1740 value = cf->args->elts;
1741
1742 for (i = 1; i < cf->args->nelts; i++) {
1743 cv = ngx_array_push(*a);
1744 if (cv == NULL) {
1745 return NGX_CONF_ERROR;
1746 }
1747
1748 ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
1749
1750 ccv.cf = cf;
1751 ccv.value = &value[i];
1752 ccv.complex_value = cv;
1753
1754 if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
1755 return NGX_CONF_ERROR;
1756 }
1757 }
1758
1759 return NGX_CONF_OK;
1760 }