Skip to content

Commit e4251ea

Browse files
committed
Merge branch 'master' of https://github.com/ctuning/ck-crowdnode
2 parents 85a194e + f9dd6dc commit e4251ea

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/ck-crowdnode-server.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,9 @@ void processShell(int sock, cJSON* commandJSON, char *baseDir) {
10591059
void processState(int sock, const char *baseDir) {
10601060
cJSON *resultJSON = cJSON_CreateObject();
10611061
cJSON_AddItemToObject(resultJSON, "return", cJSON_CreateString("0"));
1062-
cJSON_AddItemToObject(resultJSON, JSON_CONFIG_PARAM_PATH_TO_FILES, cJSON_CreateString(strdup(baseDir)));
1062+
cJSON *cfgJSON = cJSON_CreateObject();
1063+
cJSON_AddItemToObject(cfgJSON, JSON_CONFIG_PARAM_PATH_TO_FILES, cJSON_CreateString(strdup(baseDir)));
1064+
cJSON_AddItemToObject(resultJSON, "cfg", cfgJSON);
10631065
sendJson(sock, resultJSON);
10641066
cJSON_Delete(resultJSON);
10651067
}

tests/test_state.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ class TestPushPull(unittest.TestCase):
1212

1313
def test_state(self):
1414
r = access_test_repo({'action': 'state'})
15-
self.assertIn('path_to_files', r)
16-
self.assertEqual(files_dir, r['path_to_files'])
15+
cfg_ = r['cfg']
16+
self.assertIn('path_to_files', cfg_)
17+
self.assertEqual(files_dir, cfg_['path_to_files'])
1718
self.assertIn('return', r)
1819
self.assertEqual(0, r['return'])
1920

0 commit comments

Comments
 (0)