comparison src/core/ngx_conf_file.c @ 7728:485dba3e2a01

Core: ngx_conf_set_keyval_slot() now accepts NGX_CONF_UNSET_PTR. With this change, it is now possible to use ngx_conf_merge_ptr_value() to merge keyval arrays. This change actually 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). 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, 22 Oct 2020 18:00:20 +0300
parents d864ee67b5ae
children 3108d4d668e4
comparison
equal deleted inserted replaced
7727:f1e6f65ddfeb 7728:485dba3e2a01
1135 ngx_keyval_t *kv; 1135 ngx_keyval_t *kv;
1136 ngx_conf_post_t *post; 1136 ngx_conf_post_t *post;
1137 1137
1138 a = (ngx_array_t **) (p + cmd->offset); 1138 a = (ngx_array_t **) (p + cmd->offset);
1139 1139
1140 if (*a == NULL) { 1140 if (*a == NGX_CONF_UNSET_PTR || *a == NULL) {
1141 *a = ngx_array_create(cf->pool, 4, sizeof(ngx_keyval_t)); 1141 *a = ngx_array_create(cf->pool, 4, sizeof(ngx_keyval_t));
1142 if (*a == NULL) { 1142 if (*a == NULL) {
1143 return NGX_CONF_ERROR; 1143 return NGX_CONF_ERROR;
1144 } 1144 }
1145 } 1145 }