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
This commit is contained in:
Valentin Bartenev
2017-05-15 22:39:53 +03:00
parent 952ec2e0ff
commit 0ca2c2fce2
3 changed files with 115 additions and 54 deletions

View File

@@ -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);