Mercurial > hg > nginx
comparison src/http/ngx_http_file_cache.c @ 3526:62a4fd1e6e2c
proxy_no_cache and fastcgi_no_cache
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 24 May 2010 11:01:05 +0000 |
parents | ab353d7dc182 |
children | dfb17155eca9 |
comparison
equal
deleted
inserted
replaced
3525:eb156d98a9fa | 3526:62a4fd1e6e2c |
---|---|
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 } |