From 0d2d40e23192a281adaf88ce436723c8b7f5e9d3 Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Thu, 2 Jun 2022 09:36:35 +0800 Subject: Summary: Var: removing all async stuff. No functional changes. --- src/nxt_var.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nxt_var.h') diff --git a/src/nxt_var.h b/src/nxt_var.h index 3b7d0c28..7fef0278 100644 --- a/src/nxt_var.h +++ b/src/nxt_var.h @@ -12,7 +12,6 @@ typedef struct nxt_var_query_s nxt_var_query_t; typedef nxt_int_t (*nxt_var_handler_t)(nxt_task_t *task, - nxt_var_query_t *query, nxt_str_t *str, void *ctx); -- cgit From 6a8081d71e805b12d0f7fd32ce72d60babadfc85 Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Wed, 15 Jun 2022 14:27:50 +0800 Subject: Var: relocated nxt_var_is_const() and nxt_var_raw(). No functional changes. --- src/nxt_var.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nxt_var.h') diff --git a/src/nxt_var.h b/src/nxt_var.h index 7fef0278..1322d507 100644 --- a/src/nxt_var.h +++ b/src/nxt_var.h @@ -29,14 +29,14 @@ nxt_is_var(nxt_str_t *str) } -void nxt_var_raw(nxt_var_t *var, nxt_str_t *str); -nxt_bool_t nxt_var_is_const(nxt_var_t *var); - nxt_int_t nxt_var_register(nxt_var_decl_t *decl, size_t n); nxt_int_t nxt_var_index_init(void); nxt_var_t *nxt_var_compile(nxt_str_t *str, nxt_mp_t *mp, nxt_bool_t strz); nxt_int_t nxt_var_test(nxt_str_t *str, u_char *error); +void nxt_var_raw(nxt_var_t *var, nxt_str_t *str); +nxt_bool_t nxt_var_is_const(nxt_var_t *var); + nxt_int_t nxt_var_query_init(nxt_var_query_t **query_p, void *ctx, nxt_mp_t *mp); void nxt_var_query(nxt_task_t *task, nxt_var_query_t *query, -- cgit From 45b89e32577eef18e473d0c7ae24562e7efedcc0 Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Thu, 14 Jul 2022 04:32:49 +0800 Subject: Var: dynamic variables support. This commit adds the variables $arg_NAME, $header_NAME, and $cookie_NAME. --- src/nxt_var.h | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'src/nxt_var.h') diff --git a/src/nxt_var.h b/src/nxt_var.h index 1322d507..3c38be36 100644 --- a/src/nxt_var.h +++ b/src/nxt_var.h @@ -13,15 +13,25 @@ typedef struct nxt_var_query_s nxt_var_query_t; typedef nxt_int_t (*nxt_var_handler_t)(nxt_task_t *task, nxt_str_t *str, - void *ctx); + void *ctx, uint16_t field); + +typedef int64_t (*nxt_var_field_hash_t)(nxt_mp_t *mp, nxt_str_t *str); typedef struct { - nxt_str_t name; - nxt_var_handler_t handler; - uint32_t index; + nxt_str_t name; + nxt_var_handler_t handler; + nxt_var_field_hash_t field_hash; + uint32_t index; } nxt_var_decl_t; +typedef struct { + nxt_str_t name; + uint16_t hash; + uint32_t index; +} nxt_var_field_t; + + nxt_inline nxt_bool_t nxt_is_var(nxt_str_t *str) { @@ -31,11 +41,15 @@ nxt_is_var(nxt_str_t *str) nxt_int_t nxt_var_register(nxt_var_decl_t *decl, size_t n); nxt_int_t nxt_var_index_init(void); -nxt_var_t *nxt_var_compile(nxt_str_t *str, nxt_mp_t *mp, nxt_bool_t strz); -nxt_int_t nxt_var_test(nxt_str_t *str, u_char *error); -void nxt_var_raw(nxt_var_t *var, nxt_str_t *str); +nxt_var_field_t *nxt_var_field_get(nxt_array_t *fields, uint16_t index); + +nxt_var_t *nxt_var_compile(nxt_str_t *str, nxt_mp_t *mp, nxt_array_t *fields, + nxt_bool_t strz); +nxt_int_t nxt_var_test(nxt_str_t *str, nxt_array_t *fields, u_char *error); + nxt_bool_t nxt_var_is_const(nxt_var_t *var); +void nxt_var_raw(nxt_var_t *var, nxt_str_t *str); nxt_int_t nxt_var_query_init(nxt_var_query_t **query_p, void *ctx, nxt_mp_t *mp); -- cgit From 3f8cf62c03a55b9767f0c75b3df6a1a40252b19a Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Thu, 28 Jul 2022 11:05:04 +0800 Subject: Log: customizable access log format. --- src/nxt_var.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/nxt_var.h') diff --git a/src/nxt_var.h b/src/nxt_var.h index 3c38be36..cc7ff502 100644 --- a/src/nxt_var.h +++ b/src/nxt_var.h @@ -32,6 +32,12 @@ typedef struct { } nxt_var_field_t; +typedef enum { + NXT_VAR_STRZ = 1 << 0, + NXT_VAR_LOGGING = 1 << 1, +} nxt_var_flags_t; + + nxt_inline nxt_bool_t nxt_is_var(nxt_str_t *str) { @@ -45,7 +51,7 @@ nxt_int_t nxt_var_index_init(void); nxt_var_field_t *nxt_var_field_get(nxt_array_t *fields, uint16_t index); nxt_var_t *nxt_var_compile(nxt_str_t *str, nxt_mp_t *mp, nxt_array_t *fields, - nxt_bool_t strz); + nxt_var_flags_t flags); nxt_int_t nxt_var_test(nxt_str_t *str, nxt_array_t *fields, u_char *error); nxt_bool_t nxt_var_is_const(nxt_var_t *var); -- cgit