Add RPC API

This commit is contained in:
Sergey Lyubka committed 2022-07-27 00:46:05 +01:00
1 parent 9cacf443e1
commit 0dabc45780
13 files changed
+332 -75

No files matched your search

+2 -1
View File
@@ -119,9 +119,10 @@ int mg_json_get(const char *s, int len, const char *path, int *toklen) {
if (c == '"') {
int n = mg_pass_string(&s[i + 1], len - i - 1);
if (n < 0) return n;
if (i + 1 + n >= len) return MG_JSON_NOT_FOUND;
// printf("K[%.*s] %d %d\n", n, &s[i + 1], depth, ed);
if (depth == ed && path[pos - 1] == '.' &&
memcmp(&s[i + 1], &path[pos], (size_t) n) == 0) {
strncmp(&s[i + 1], &path[pos], (size_t) n) == 0) {
pos += n;
}
i += n + 1;