summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_tstr.c
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2023-05-10 10:29:16 -0700
committerKonstantin Pavlov <thresh@nginx.com>2023-05-10 10:29:16 -0700
commit69235c513277c64b513447d9b92c3c03d616f577 (patch)
tree0780c92ba28d92b547c85ea0bee5e3040e14dee2 /src/nxt_tstr.c
parentb9bc222021e77bbdfb12576b3e315b962cf6b399 (diff)
parentfaf97dc06058de1c929af33a68adb34d3932b374 (diff)
downloadunit-1.30.0-1.tar.gz
unit-1.30.0-1.tar.bz2
Merged with the default branch.1.30.0-1
Diffstat (limited to '')
-rw-r--r--src/nxt_tstr.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nxt_tstr.c b/src/nxt_tstr.c
index fda585b8..516415d9 100644
--- a/src/nxt_tstr.c
+++ b/src/nxt_tstr.c
@@ -70,7 +70,7 @@ nxt_tstr_state_new(nxt_mp_t *mp, nxt_bool_t test)
}
#if (NXT_HAVE_NJS)
- state->jcf = nxt_js_conf_new(mp);
+ state->jcf = nxt_js_conf_new(mp, test);
if (nxt_slow_path(state->jcf == NULL)) {
return NULL;
}
@@ -273,7 +273,8 @@ nxt_tstr_query(nxt_task_t *task, nxt_tstr_query_t *query, nxt_tstr_t *tstr,
} else {
#if (NXT_HAVE_NJS)
- ret = nxt_js_call(task, &query->cache->js, tstr->u.js, val, query->ctx);
+ ret = nxt_js_call(task, query->state->jcf, &query->cache->js,
+ tstr->u.js, val, query->ctx);
if (nxt_slow_path(ret != NXT_OK)) {
query->failed = 1;
@@ -296,6 +297,13 @@ nxt_tstr_query(nxt_task_t *task, nxt_tstr_query_t *query, nxt_tstr_t *tstr,
}
+nxt_bool_t
+nxt_tstr_query_failed(nxt_tstr_query_t *query)
+{
+ return query->failed;
+}
+
+
void
nxt_tstr_query_resolve(nxt_task_t *task, nxt_tstr_query_t *query, void *data,
nxt_work_handler_t ready, nxt_work_handler_t error)