diff options
author | Zhidao HONG <z.hong@f5.com> | 2022-06-02 09:36:35 +0800 |
---|---|---|
committer | Zhidao HONG <z.hong@f5.com> | 2022-06-02 09:36:35 +0800 |
commit | 0d2d40e23192a281adaf88ce436723c8b7f5e9d3 (patch) | |
tree | fda9a80cb70bba064a42c17d1b9833502c024188 | |
parent | 4f16479482f4902aecefdbcd16f3d6e3bf6b67a4 (diff) | |
download | unit-0d2d40e23192a281adaf88ce436723c8b7f5e9d3.tar.gz unit-0d2d40e23192a281adaf88ce436723c8b7f5e9d3.tar.bz2 |
Summary: Var: removing all async stuff.
No functional changes.
-rw-r--r-- | src/nxt_http_variables.c | 26 | ||||
-rw-r--r-- | src/nxt_var.c | 13 | ||||
-rw-r--r-- | src/nxt_var.h | 1 |
3 files changed, 14 insertions, 26 deletions
diff --git a/src/nxt_http_variables.c b/src/nxt_http_variables.c index b765e177..c48f9ca3 100644 --- a/src/nxt_http_variables.c +++ b/src/nxt_http_variables.c @@ -7,14 +7,12 @@ #include <nxt_http.h> -static nxt_int_t nxt_http_var_method(nxt_task_t *task, nxt_var_query_t *query, - nxt_str_t *str, void *ctx); -static nxt_int_t nxt_http_var_request_uri(nxt_task_t *task, - nxt_var_query_t *query, nxt_str_t *str, void *ctx); -static nxt_int_t nxt_http_var_uri(nxt_task_t *task, nxt_var_query_t *query, - nxt_str_t *str, void *ctx); -static nxt_int_t nxt_http_var_host(nxt_task_t *task, nxt_var_query_t *query, - nxt_str_t *str, void *ctx); +static nxt_int_t nxt_http_var_method(nxt_task_t *task, nxt_str_t *str, + void *ctx); +static nxt_int_t nxt_http_var_request_uri(nxt_task_t *task, nxt_str_t *str, + void *ctx); +static nxt_int_t nxt_http_var_uri(nxt_task_t *task, nxt_str_t *str, void *ctx); +static nxt_int_t nxt_http_var_host(nxt_task_t *task, nxt_str_t *str, void *ctx); static nxt_var_decl_t nxt_http_vars[] = { @@ -44,8 +42,7 @@ nxt_http_register_variables(void) static nxt_int_t -nxt_http_var_method(nxt_task_t *task, nxt_var_query_t *query, nxt_str_t *str, - void *ctx) +nxt_http_var_method(nxt_task_t *task, nxt_str_t *str, void *ctx) { nxt_http_request_t *r; @@ -58,8 +55,7 @@ nxt_http_var_method(nxt_task_t *task, nxt_var_query_t *query, nxt_str_t *str, static nxt_int_t -nxt_http_var_request_uri(nxt_task_t *task, nxt_var_query_t *query, - nxt_str_t *str, void *ctx) +nxt_http_var_request_uri(nxt_task_t *task, nxt_str_t *str, void *ctx) { nxt_http_request_t *r; @@ -72,8 +68,7 @@ nxt_http_var_request_uri(nxt_task_t *task, nxt_var_query_t *query, static nxt_int_t -nxt_http_var_uri(nxt_task_t *task, nxt_var_query_t *query, nxt_str_t *str, - void *ctx) +nxt_http_var_uri(nxt_task_t *task, nxt_str_t *str, void *ctx) { nxt_http_request_t *r; @@ -86,8 +81,7 @@ nxt_http_var_uri(nxt_task_t *task, nxt_var_query_t *query, nxt_str_t *str, static nxt_int_t -nxt_http_var_host(nxt_task_t *task, nxt_var_query_t *query, nxt_str_t *str, - void *ctx) +nxt_http_var_host(nxt_task_t *task, nxt_str_t *str, void *ctx) { nxt_http_request_t *r; diff --git a/src/nxt_var.c b/src/nxt_var.c index 0a722d17..458ba678 100644 --- a/src/nxt_var.c +++ b/src/nxt_var.c @@ -494,17 +494,12 @@ nxt_var_query(nxt_task_t *task, nxt_var_query_t *query, nxt_var_t *var, continue; /* NXT_DECLINED */ } - ret = nxt_var_index[index](task, query, value, query->ctx); + ret = nxt_var_index[index](task, value, query->ctx); + if (nxt_slow_path(ret != NXT_OK)) { + goto fail; + } value = NULL; - - if (ret != NXT_OK) { - if (nxt_slow_path(ret != NXT_AGAIN)) { - goto fail; - } - - query->waiting++; - } } query->spare = value; 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); |