nxt_var.c (1953:6b3c68839a11) nxt_var.c (1954:8f18a05d4c58)
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <nxt_main.h>
7
8

--- 76 unchanged lines hidden (view full) ---

85
86
87static nxt_lvlhsh_t nxt_var_hash;
88static uint32_t nxt_var_count;
89
90static nxt_var_handler_t *nxt_var_index;
91
92
1
2/*
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <nxt_main.h>
7
8

--- 76 unchanged lines hidden (view full) ---

85
86
87static nxt_lvlhsh_t nxt_var_hash;
88static uint32_t nxt_var_count;
89
90static nxt_var_handler_t *nxt_var_index;
91
92
93void
94nxt_var_raw(nxt_var_t *var, nxt_str_t *str)
95{
96 str->length = var->length;
97 str->start = nxt_var_raw_start(var);
98}
99
100
101nxt_bool_t
102nxt_var_is_const(nxt_var_t *var)
103{
104 return (var->vars == 0);
105}
106
107
93static nxt_int_t
94nxt_var_hash_test(nxt_lvlhsh_query_t *lhq, void *data)
95{
96 nxt_var_decl_t *decl;
97
98 decl = data;
99
100 return nxt_strstr_eq(&lhq->key, &decl->name) ? NXT_OK : NXT_DECLINED;

--- 333 unchanged lines hidden (view full) ---

434 uint32_t index;
435 nxt_mp_t *mp;
436 nxt_str_t *value;
437 nxt_int_t ret;
438 nxt_uint_t i;
439 nxt_var_sub_t *subs;
440 nxt_var_value_t *val;
441
108static nxt_int_t
109nxt_var_hash_test(nxt_lvlhsh_query_t *lhq, void *data)
110{
111 nxt_var_decl_t *decl;
112
113 decl = data;
114
115 return nxt_strstr_eq(&lhq->key, &decl->name) ? NXT_OK : NXT_DECLINED;

--- 333 unchanged lines hidden (view full) ---

449 uint32_t index;
450 nxt_mp_t *mp;
451 nxt_str_t *value;
452 nxt_int_t ret;
453 nxt_uint_t i;
454 nxt_var_sub_t *subs;
455 nxt_var_value_t *val;
456
442 if (var->vars == 0) {
443 str->length = var->length;
444 str->start = nxt_var_raw_start(var);
457 if (nxt_var_is_const(var)) {
458 nxt_var_raw(var, str);
445 return;
446 }
447
448 if (nxt_slow_path(query->failed)) {
449 return;
450 }
451
452 mp = query->values.mem_pool;

--- 160 unchanged lines hidden ---
459 return;
460 }
461
462 if (nxt_slow_path(query->failed)) {
463 return;
464 }
465
466 mp = query->values.mem_pool;

--- 160 unchanged lines hidden ---