summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_controller.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2017-06-23 20:54:07 +0300
committerValentin Bartenev <vbart@nginx.com>2017-06-23 20:54:07 +0300
commit72429410f78721a7c7076d4684e4c23e47d80bcf (patch)
tree86c6a0480aad9da30ef636b5f0082cee50604cdb /src/nxt_controller.c
parent83088a0f4bdbe321c42e7cf0b18e2a9cc897b068 (diff)
downloadunit-72429410f78721a7c7076d4684e4c23e47d80bcf.tar.gz
unit-72429410f78721a7c7076d4684e4c23e47d80bcf.tar.bz2
Renames and reordering of parameters in configuration parser functions.
Requested by Igor.
Diffstat (limited to '')
-rw-r--r--src/nxt_controller.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/nxt_controller.c b/src/nxt_controller.c
index f96f93ef..f20fd685 100644
--- a/src/nxt_controller.c
+++ b/src/nxt_controller.c
@@ -108,7 +108,7 @@ nxt_controller_start(nxt_task_t *task, nxt_runtime_t *rt)
return NXT_ERROR;
}
- conf = nxt_conf_json_parse(json.start, json.length, mp);
+ conf = nxt_conf_json_str_parse(mp, &json);
if (conf == NULL) {
return NXT_ERROR;
@@ -591,7 +591,7 @@ nxt_controller_process_request(nxt_task_t *task, nxt_conn_t *c,
mbuf = &c->read->mem;
- value = nxt_conf_json_parse(mbuf->pos, mbuf->free - mbuf->pos, mp);
+ value = nxt_conf_json_parse(mp, mbuf->pos, mbuf->free);
if (value == NULL) {
nxt_mp_destroy(mp);
@@ -600,8 +600,9 @@ nxt_controller_process_request(nxt_task_t *task, nxt_conn_t *c,
}
if (path.length != 1) {
- rc = nxt_conf_json_op_compile(nxt_controller_conf.root, value,
- &ops, &path, c->mem_pool);
+ rc = nxt_conf_json_op_compile(c->mem_pool, &ops,
+ nxt_controller_conf.root,
+ &path, value);
if (rc != NXT_OK) {
if (rc == NXT_DECLINED) {
@@ -613,8 +614,8 @@ nxt_controller_process_request(nxt_task_t *task, nxt_conn_t *c,
goto done;
}
- value = nxt_conf_json_clone_value(nxt_controller_conf.root,
- ops, mp);
+ value = nxt_conf_json_clone_value(mp, ops,
+ nxt_controller_conf.root);
if (nxt_slow_path(value == NULL)) {
nxt_mp_destroy(mp);
@@ -644,11 +645,12 @@ nxt_controller_process_request(nxt_task_t *task, nxt_conn_t *c,
goto done;
}
- value = nxt_conf_json_parse(empty_obj.start, empty_obj.length, mp);
+ value = nxt_conf_json_str_parse(mp, &empty_obj);
} else {
- rc = nxt_conf_json_op_compile(nxt_controller_conf.root, NULL, &ops,
- &path, c->mem_pool);
+ rc = nxt_conf_json_op_compile(c->mem_pool, &ops,
+ nxt_controller_conf.root,
+ &path, NULL);
if (rc != NXT_OK) {
if (rc == NXT_DECLINED) {
@@ -667,8 +669,8 @@ nxt_controller_process_request(nxt_task_t *task, nxt_conn_t *c,
goto done;
}
- value = nxt_conf_json_clone_value(nxt_controller_conf.root,
- ops, mp);
+ value = nxt_conf_json_clone_value(mp, ops,
+ nxt_controller_conf.root);
}
if (nxt_slow_path(value == NULL)) {
@@ -775,8 +777,7 @@ nxt_controller_response_body(nxt_controller_response_t *resp, nxt_mp_t *pool)
value = resp->json_value;
} else {
- value = nxt_conf_json_parse(resp->json_string.start,
- resp->json_string.length, pool);
+ value = nxt_conf_json_str_parse(pool, &resp->json_string);
if (nxt_slow_path(value == NULL)) {
return NULL;