diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/.travis.yml b/.travis.yml old mode 100755 new mode 100644 diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/debian/config b/debian/config old mode 100755 new mode 100644 diff --git a/debian/postinst b/debian/postinst old mode 100755 new mode 100644 diff --git a/debian/postrm b/debian/postrm old mode 100755 new mode 100644 diff --git a/debian/rules b/debian/rules old mode 100755 new mode 100644 diff --git a/debian/templates b/debian/templates old mode 100755 new mode 100644 diff --git a/dist/etc/network/default.cfg b/dist/etc/network/default.cfg deleted file mode 120000 index e0c658762b94b49762e533e430958f5d28a94c7f..0000000000000000000000000000000000000000 --- a/dist/etc/network/default.cfg +++ /dev/null @@ -1 +0,0 @@ -kelvin-testnet.cfg \ No newline at end of file diff --git a/dist/etc/network/default.cfg b/dist/etc/network/default.cfg new file mode 100644 index 0000000000000000000000000000000000000000..e0c658762b94b49762e533e430958f5d28a94c7f --- /dev/null +++ b/dist/etc/network/default.cfg @@ -0,0 +1 @@ +kelvin-testnet.cfg \ No newline at end of file diff --git a/dist/etc/network/kelvin-testnet/chain-0.cfg b/dist/etc/network/kelvin-testnet/chain-0.cfg old mode 100755 new mode 100644 diff --git a/dist/etc/network/kelvin-testnet/chain-gdb.cfg b/dist/etc/network/kelvin-testnet/chain-gdb.cfg old mode 100755 new mode 100644 diff --git a/dist/etc/network/kelvin-testnet/chain-plasma.cfg b/dist/etc/network/kelvin-testnet/chain-plasma.cfg old mode 100755 new mode 100644 diff --git a/dist/share/configs/kelvin-node.cfg.tpl b/dist/share/configs/kelvin-node.cfg.tpl old mode 100755 new mode 100644 diff --git a/dist/share/configs/network/kelvin-testnet.cfg.tpl b/dist/share/configs/network/kelvin-testnet.cfg.tpl old mode 100755 new mode 100644 diff --git a/dist/share/kelvin-node.service b/dist/share/kelvin-node.service old mode 100755 new mode 100644 diff --git a/docs/ChainFrame b/docs/ChainFrame old mode 100755 new mode 100644 diff --git a/docs/ChainFrame.dia b/docs/ChainFrame.dia old mode 100755 new mode 100644 diff --git a/docs/ChainFrame.png b/docs/ChainFrame.png old mode 100755 new mode 100644 diff --git a/docs/Consensuses.dia b/docs/Consensuses.dia old mode 100755 new mode 100644 diff --git a/docs/Consensuses.png b/docs/Consensuses.png old mode 100755 new mode 100644 diff --git a/docs/Consensuses_cells.dia b/docs/Consensuses_cells.dia old mode 100755 new mode 100644 diff --git a/docs/Consensuses_sharding.dia b/docs/Consensuses_sharding.dia old mode 100755 new mode 100644 diff --git a/docs/Consensuses_sharding.png b/docs/Consensuses_sharding.png old mode 100755 new mode 100644 diff --git a/docs/Consensuses_zero_chain.dia b/docs/Consensuses_zero_chain.dia old mode 100755 new mode 100644 diff --git a/docs/Consensuses_zero_chain.png b/docs/Consensuses_zero_chain.png old mode 100755 new mode 100644 diff --git a/sources/main.c b/sources/main.c old mode 100755 new mode 100644 diff --git a/sources/main_node_cli.c b/sources/main_node_cli.c old mode 100755 new mode 100644 diff --git a/sources/main_node_cli.h b/sources/main_node_cli.h old mode 100755 new mode 100644 diff --git a/sources/main_node_cli_net.c b/sources/main_node_cli_net.c old mode 100755 new mode 100644 index 65a87bd7d5137be7b09594886c2f4a7310156601..087bd29709ae4c2943a229f1cc731f820a30da16 --- a/sources/main_node_cli_net.c +++ b/sources/main_node_cli_net.c @@ -150,6 +150,7 @@ int node_cli_post_command(connect_param *conn, cmd_state *cmd) size_t post_data_len = 0; add_mem_data((uint8_t**) &post_data, &post_data_len, cmd->cmd_name, strlen(cmd->cmd_name)); + if(cmd->cmd_param) { for(int i = 0; i < cmd->cmd_param_count; i++) { if(cmd->cmd_param[i]) { @@ -158,35 +159,36 @@ int node_cli_post_command(connect_param *conn, cmd_state *cmd) } } } - add_mem_data((uint8_t**) &post_data, &post_data_len, "\r\n\r\n", 4); - if (post_data) - ret = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post_data); // data for POST request - if (post_data_len >= 0) - ret = curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, - (long )post_data_len); // if need a lot to send: CURLOPT_POSTFIELDSIZE_LARGE - // sending request and receiving the http page (filling cmd) - //printf("cmd='%s'\n", cmd->cmd_name); - ret = curl_easy_perform(curl); // curl_easy_send - - if (ret != CURLE_OK) { - printf("Error (err_code=%d)\n", ret); - exit(-1); - } - int l_err_code = -1; - if (cmd->cmd_res) { - char **l_str = dap_strsplit(cmd->cmd_res, "\r\n", 1); - int l_cnt = dap_str_countv(l_str); - char *l_str_reply = NULL; - if (l_cnt == 2) { - l_err_code = strtol(l_str[0], NULL, 10); - l_str_reply = l_str[1]; - } - printf("%s\n", (l_str_reply) ? l_str_reply : "no response"); - dap_strfreev(l_str); - } - DAP_DELETE(post_data); - exit(l_err_code); - return 0; + + add_mem_data((uint8_t**) &post_data, &post_data_len, "\r\n\r\n", 4); + if (post_data) + ret = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, post_data); // data for POST request + if (post_data_len >= 0) + ret = curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, + (long )post_data_len); // if need a lot to send: CURLOPT_POSTFIELDSIZE_LARGE + // sending request and receiving the http page (filling cmd) + //printf("cmd='%s'\n", cmd->cmd_name); + ret = curl_easy_perform(curl); // curl_easy_send + + if (ret != CURLE_OK) { + printf("Error (err_code=%d)\n", ret); + exit(-1); + } + int l_err_code = -1; + if (cmd->cmd_res) { + char **l_str = dap_strsplit(cmd->cmd_res, "\r\n", 1); + int l_cnt = dap_str_countv(l_str); + char *l_str_reply = NULL; + if (l_cnt == 2) { + l_err_code = strtol(l_str[0], NULL, 10); + l_str_reply = l_str[1]; + } + printf("%s\n", (l_str_reply) ? l_str_reply : "no response"); + dap_strfreev(l_str); + } + DAP_DELETE(post_data); + exit(l_err_code); + return 0; } int node_cli_desconnect(connect_param *param) diff --git a/sources/main_node_cli_net.h b/sources/main_node_cli_net.h old mode 100755 new mode 100644 diff --git a/sources/main_node_cli_shell.c b/sources/main_node_cli_shell.c old mode 100755 new mode 100644 diff --git a/sources/main_node_cli_shell.h b/sources/main_node_cli_shell.h old mode 100755 new mode 100644 diff --git a/sources/main_node_tool.c b/sources/main_node_tool.c old mode 100755 new mode 100644 diff --git a/sources/node_manager.c b/sources/node_manager.c old mode 100755 new mode 100644 diff --git a/sources/node_manager.h b/sources/node_manager.h old mode 100755 new mode 100644 diff --git a/sources/sig_unix_handler.c b/sources/sig_unix_handler.c old mode 100755 new mode 100644 diff --git a/sources/sig_unix_handler.h b/sources/sig_unix_handler.h old mode 100755 new mode 100644 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/test/main.c b/test/main.c old mode 100755 new mode 100644