Mercurial > hg > nginx
comparison src/http/ngx_http_script.c @ 7831:bdd4d89370a7
Changed complex value slots to use NGX_CONF_UNSET_PTR.
With this change, it is now possible to use ngx_conf_merge_ptr_value()
to merge complex values. This change follows much earlier changes in
ngx_conf_merge_ptr_value() and ngx_conf_set_str_array_slot()
in 1452:cd586e963db0 (0.6.10) and 1701:40d004d95d88 (0.6.22), and the
change in ngx_conf_set_keyval_slot() (7728:485dba3e2a01, 1.19.4).
To preserve compatibility with existing 3rd party modules, both NULL
and NGX_CONF_UNSET_PTR are accepted for now.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 06 May 2021 02:22:03 +0300 |
parents | 7aa20af4ac00 |
children | 3ab8e1e2f0f7 |
comparison
equal
deleted
inserted
replaced
7830:f2ff291bbdac | 7831:bdd4d89370a7 |
---|---|
248 ngx_http_complex_value_t **cv; | 248 ngx_http_complex_value_t **cv; |
249 ngx_http_compile_complex_value_t ccv; | 249 ngx_http_compile_complex_value_t ccv; |
250 | 250 |
251 cv = (ngx_http_complex_value_t **) (p + cmd->offset); | 251 cv = (ngx_http_complex_value_t **) (p + cmd->offset); |
252 | 252 |
253 if (*cv != NULL) { | 253 if (*cv != NGX_CONF_UNSET_PTR && *cv != NULL) { |
254 return "is duplicate"; | 254 return "is duplicate"; |
255 } | 255 } |
256 | 256 |
257 *cv = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t)); | 257 *cv = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t)); |
258 if (*cv == NULL) { | 258 if (*cv == NULL) { |