Mercurial > hg > nginx
comparison src/http/modules/ngx_http_uwsgi_module.c @ 5907:195561ef367f
Upstream: moved header initializations to separate functions.
No functional changes.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Wed, 19 Nov 2014 17:33:21 +0300 |
parents | 2f7e557eab5b |
children | f8e80f8c7fc7 |
comparison
equal
deleted
inserted
replaced
5906:548f704c1907 | 5907:195561ef367f |
---|---|
60 ngx_int_t rc); | 60 ngx_int_t rc); |
61 | 61 |
62 static void *ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf); | 62 static void *ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf); |
63 static char *ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, | 63 static char *ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, |
64 void *child); | 64 void *child); |
65 static ngx_int_t ngx_http_uwsgi_merge_params(ngx_conf_t *cf, | 65 static ngx_int_t ngx_http_uwsgi_init_params(ngx_conf_t *cf, |
66 ngx_http_uwsgi_loc_conf_t *conf, ngx_http_uwsgi_loc_conf_t *prev); | 66 ngx_http_uwsgi_loc_conf_t *conf); |
67 | 67 |
68 static char *ngx_http_uwsgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, | 68 static char *ngx_http_uwsgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, |
69 void *conf); | 69 void *conf); |
70 static char *ngx_http_uwsgi_store(ngx_conf_t *cf, ngx_command_t *cmd, | 70 static char *ngx_http_uwsgi_store(ngx_conf_t *cf, ngx_command_t *cmd, |
71 void *conf); | 71 void *conf); |
1703 } | 1703 } |
1704 | 1704 |
1705 ngx_conf_merge_uint_value(conf->modifier1, prev->modifier1, 0); | 1705 ngx_conf_merge_uint_value(conf->modifier1, prev->modifier1, 0); |
1706 ngx_conf_merge_uint_value(conf->modifier2, prev->modifier2, 0); | 1706 ngx_conf_merge_uint_value(conf->modifier2, prev->modifier2, 0); |
1707 | 1707 |
1708 if (ngx_http_uwsgi_merge_params(cf, conf, prev) != NGX_OK) { | 1708 if (conf->params_source == NULL) { |
1709 conf->params_source = prev->params_source; | |
1710 | |
1711 #if (NGX_HTTP_CACHE) | |
1712 if ((conf->upstream.cache == NULL) == (prev->upstream.cache == NULL)) | |
1713 #endif | |
1714 { | |
1715 conf->flushes = prev->flushes; | |
1716 conf->params_len = prev->params_len; | |
1717 conf->params = prev->params; | |
1718 conf->headers_hash = prev->headers_hash; | |
1719 conf->header_params = prev->header_params; | |
1720 } | |
1721 } | |
1722 | |
1723 if (ngx_http_uwsgi_init_params(cf, conf) != NGX_OK) { | |
1709 return NGX_CONF_ERROR; | 1724 return NGX_CONF_ERROR; |
1710 } | 1725 } |
1711 | 1726 |
1712 return NGX_CONF_OK; | 1727 return NGX_CONF_OK; |
1713 } | 1728 } |
1714 | 1729 |
1715 | 1730 |
1716 static ngx_int_t | 1731 static ngx_int_t |
1717 ngx_http_uwsgi_merge_params(ngx_conf_t *cf, ngx_http_uwsgi_loc_conf_t *conf, | 1732 ngx_http_uwsgi_init_params(ngx_conf_t *cf, ngx_http_uwsgi_loc_conf_t *conf) |
1718 ngx_http_uwsgi_loc_conf_t *prev) | |
1719 { | 1733 { |
1720 u_char *p; | 1734 u_char *p; |
1721 size_t size; | 1735 size_t size; |
1722 uintptr_t *code; | 1736 uintptr_t *code; |
1723 ngx_uint_t i, nsrc; | 1737 ngx_uint_t i, nsrc; |
1729 ngx_hash_init_t hash; | 1743 ngx_hash_init_t hash; |
1730 ngx_http_upstream_param_t *src; | 1744 ngx_http_upstream_param_t *src; |
1731 ngx_http_script_compile_t sc; | 1745 ngx_http_script_compile_t sc; |
1732 ngx_http_script_copy_code_t *copy; | 1746 ngx_http_script_copy_code_t *copy; |
1733 | 1747 |
1734 if (conf->params_source == NULL) { | 1748 if (conf->headers_hash.buckets) { |
1735 conf->params_source = prev->params_source; | 1749 return NGX_OK; |
1736 | |
1737 if (prev->headers_hash.buckets | |
1738 #if (NGX_HTTP_CACHE) | |
1739 && ((conf->upstream.cache == NULL) | |
1740 == (prev->upstream.cache == NULL)) | |
1741 #endif | |
1742 ) | |
1743 { | |
1744 conf->flushes = prev->flushes; | |
1745 conf->params_len = prev->params_len; | |
1746 conf->params = prev->params; | |
1747 conf->headers_hash = prev->headers_hash; | |
1748 conf->header_params = prev->header_params; | |
1749 | |
1750 return NGX_OK; | |
1751 } | |
1752 } | 1750 } |
1753 | 1751 |
1754 if (conf->params_source == NULL | 1752 if (conf->params_source == NULL |
1755 #if (NGX_HTTP_CACHE) | 1753 #if (NGX_HTTP_CACHE) |
1756 && (conf->upstream.cache == NULL) | 1754 && (conf->upstream.cache == NULL) |