comparison src/stream/ngx_stream_script.c @ 7833:3ab8e1e2f0f7

Upstream: variables support in certificates.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 06 May 2021 02:22:09 +0300
parents bdd4d89370a7
children
comparison
equal deleted inserted replaced
7832:be82e72c9af8 7833:3ab8e1e2f0f7
276 return NGX_CONF_OK; 276 return NGX_CONF_OK;
277 } 277 }
278 278
279 279
280 char * 280 char *
281 ngx_stream_set_complex_value_zero_slot(ngx_conf_t *cf, ngx_command_t *cmd,
282 void *conf)
283 {
284 char *p = conf;
285
286 ngx_str_t *value;
287 ngx_stream_complex_value_t **cv;
288 ngx_stream_compile_complex_value_t ccv;
289
290 cv = (ngx_stream_complex_value_t **) (p + cmd->offset);
291
292 if (*cv != NGX_CONF_UNSET_PTR) {
293 return "is duplicate";
294 }
295
296 *cv = ngx_palloc(cf->pool, sizeof(ngx_stream_complex_value_t));
297 if (*cv == NULL) {
298 return NGX_CONF_ERROR;
299 }
300
301 value = cf->args->elts;
302
303 ngx_memzero(&ccv, sizeof(ngx_stream_compile_complex_value_t));
304
305 ccv.cf = cf;
306 ccv.value = &value[1];
307 ccv.complex_value = *cv;
308 ccv.zero = 1;
309
310 if (ngx_stream_compile_complex_value(&ccv) != NGX_OK) {
311 return NGX_CONF_ERROR;
312 }
313
314 return NGX_CONF_OK;
315 }
316
317
318 char *
281 ngx_stream_set_complex_value_size_slot(ngx_conf_t *cf, ngx_command_t *cmd, 319 ngx_stream_set_complex_value_size_slot(ngx_conf_t *cf, ngx_command_t *cmd,
282 void *conf) 320 void *conf)
283 { 321 {
284 char *p = conf; 322 char *p = conf;
285 323