|
|
@ -823,9 +823,11 @@ int main(int argc, char *argv[]) {
|
|
|
|
char config_buf[8192];
|
|
|
|
char config_buf[8192];
|
|
|
|
len = read_file(config_buf, sizeof(config_buf), "%s/config", app_dir);
|
|
|
|
len = read_file(config_buf, sizeof(config_buf), "%s/config", app_dir);
|
|
|
|
if (len > 0) {
|
|
|
|
if (len > 0) {
|
|
|
|
|
|
|
|
ssize_t key_len = json_get_value(config_buf, "key", &key);
|
|
|
|
ssize_t host_len = json_get_value(config_buf, "host", &host);
|
|
|
|
ssize_t host_len = json_get_value(config_buf, "host", &host);
|
|
|
|
ssize_t port_len = json_get_value(config_buf, "port", &port);
|
|
|
|
ssize_t port_len = json_get_value(config_buf, "port", &port);
|
|
|
|
ssize_t shs_cap_len = json_get_value(config_buf, "caps.shs", &shs_cap_key_str);
|
|
|
|
ssize_t shs_cap_len = json_get_value(config_buf, "caps.shs", &shs_cap_key_str);
|
|
|
|
|
|
|
|
if (key_len >= 0) ((char *)key)[key_len] = '\0';
|
|
|
|
if (host_len >= 0) ((char *)host)[host_len] = '\0';
|
|
|
|
if (host_len >= 0) ((char *)host)[host_len] = '\0';
|
|
|
|
if (port_len >= 0) ((char *)port)[port_len] = '\0';
|
|
|
|
if (port_len >= 0) ((char *)port)[port_len] = '\0';
|
|
|
|
if (shs_cap_len >= 0) ((char *)shs_cap_key_str)[shs_cap_len] = '\0';
|
|
|
|
if (shs_cap_len >= 0) ((char *)shs_cap_key_str)[shs_cap_len] = '\0';
|
|
|
|