diff options
author | Valentin Bartenev <vbart@nginx.com> | 2017-05-15 22:39:53 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2017-05-15 22:39:53 +0300 |
commit | 0ca2c2fce2c21a397fc10d19bca6628df7bc62ab (patch) | |
tree | 8c30ef891363b35867cf2e3cc6cdc16d4ba039e3 /src/nxt_conf_json.c | |
parent | 952ec2e0ffa37a139844d4883c254e375e7618e2 (diff) | |
download | unit-0ca2c2fce2c21a397fc10d19bca6628df7bc62ab.tar.gz unit-0ca2c2fce2c21a397fc10d19bca6628df7bc62ab.tar.bz2 |
Controller: trivial abilities to save and request configuration.
Now you can get current configuration with:
$ curl 127.0.0.1:8443
and put new configuration with:
$ curl -X PUT -d @conf.json 127.0.0.1:8443
Diffstat (limited to '')
-rw-r--r-- | src/nxt_conf_json.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nxt_conf_json.c b/src/nxt_conf_json.c index 5808e5a6..b2b830e0 100644 --- a/src/nxt_conf_json.c +++ b/src/nxt_conf_json.c @@ -169,9 +169,9 @@ nxt_conf_json_object_member_get(nxt_lvlhsh_t *lvlhsh, u_char *name, nxt_conf_json_value_t * -nxt_conf_json_parse(nxt_buf_mem_t *b, nxt_mem_pool_t *pool) +nxt_conf_json_parse(u_char *pos, size_t length, nxt_mem_pool_t *pool) { - u_char *pos, *end; + u_char *end; nxt_conf_json_value_t *value; value = nxt_mem_alloc(pool, sizeof(nxt_conf_json_value_t)); @@ -179,8 +179,7 @@ nxt_conf_json_parse(nxt_buf_mem_t *b, nxt_mem_pool_t *pool) return NULL; } - pos = b->pos; - end = b->free; + end = pos + length; pos = nxt_conf_json_skip_space(pos, end); |