diff --git a/3rdparty/cuttdb/src/cdb_bgtask.c b/3rdparty/cuttdb/src/cdb_bgtask.c index 1d16c81a95ec1a5b83b64283150fe97e86f83d64..d12bd26e6c3b35e61e97aab1f2be49b10ea9cd80 100644 --- a/3rdparty/cuttdb/src/cdb_bgtask.c +++ b/3rdparty/cuttdb/src/cdb_bgtask.c @@ -16,14 +16,7 @@ #include "cdb_bgtask.h" #include <stdlib.h> #include <errno.h> -#if defined(DAP_OS_DARWIN) #include <signal.h> -#elif defined(_WIN32) -#include <sys/signal.h> -#else -#include <signal.h> -#endif - /* where thread begins */ static void *_cdb_bgtask_func(void *arg); diff --git a/modules/chain/dap_chain_cell.c b/modules/chain/dap_chain_cell.c index 238e97a4a69df20aafab2d60b05c1d165f0dfa1c..8e44c836749ef016857260637011c9092096f604 100644 --- a/modules/chain/dap_chain_cell.c +++ b/modules/chain/dap_chain_cell.c @@ -115,14 +115,13 @@ void dap_chain_cell_delete(dap_chain_cell_t *a_cell) int dap_chain_cell_load(dap_chain_t * a_chain, const char * a_cell_file_path) { dap_chain_cell_t * l_cell = dap_chain_cell_create(); - l_cell->file_storage_path = dap_strdup( a_cell_file_path ); - - char *l_file_path = dap_strdup_printf("%s/%s", DAP_CHAIN_PVT (a_chain)->file_storage_dir, - l_cell->file_storage_path); - - l_cell->file_storage = fopen(l_file_path,"rb"); - DAP_DELETE(l_file_path); + { + char l_file_path[MAX_PATH] = {'\0'}; + dap_snprintf(l_file_path, MAX_PATH, "%s/%s", DAP_CHAIN_PVT(a_chain)->file_storage_dir, + l_cell->file_storage_path); + l_cell->file_storage = fopen(l_file_path,"rb"); + } if ( l_cell->file_storage ){ dap_chain_cell_file_header_t l_hdr = {0}; if ( fread( &l_hdr,1,sizeof(l_hdr),l_cell->file_storage ) == sizeof (l_hdr) ) { @@ -186,12 +185,12 @@ int dap_chain_cell_file_append( dap_chain_cell_t * a_cell, const void* a_atom, s size_t l_total_wrote_bytes = 0; // file need to be opened or created if(a_cell->file_storage == NULL) { - char *l_file_path = dap_strdup_printf("%s/%s", DAP_CHAIN_PVT ( a_cell->chain)->file_storage_dir, - a_cell->file_storage_path); + char l_file_path[MAX_PATH] = {'\0'}; + dap_snprintf(l_file_path, MAX_PATH, "%s/%s", DAP_CHAIN_PVT(a_cell->chain)->file_storage_dir, + a_cell->file_storage_path); a_cell->file_storage = fopen(l_file_path, "ab"); if(a_cell->file_storage == NULL) a_cell->file_storage = fopen(l_file_path, "wb"); - DAP_DELETE(l_file_path); } if(!a_cell->file_storage) { log_it(L_ERROR, "File \"%s\" not opened for write cell 0x%016X", @@ -255,10 +254,10 @@ int dap_chain_cell_file_update( dap_chain_cell_t * a_cell) return -1; } if(a_cell->file_storage == NULL ){ // File need to be created - char *l_file_path = dap_strdup_printf("%s/%s", DAP_CHAIN_PVT ( a_cell->chain)->file_storage_dir, - a_cell->file_storage_path); + char l_file_path[MAX_PATH] = {'\0'}; + dap_snprintf(l_file_path, MAX_PATH, "%s/%s", DAP_CHAIN_PVT(a_cell->chain)->file_storage_dir, + a_cell->file_storage_path); a_cell->file_storage = fopen(l_file_path, "wb"); - DAP_DELETE(l_file_path); if(a_cell->file_storage) { dap_chain_cell_file_header_t l_hdr = { .signature = DAP_CHAIN_CELL_FILE_SIGNATURE, diff --git a/modules/channel/chain/dap_stream_ch_chain.c b/modules/channel/chain/dap_stream_ch_chain.c index 96fecb6129a77c63175bf8c4a87ac89c2176ec3b..86a353e7ec4526bdfec864dab5b2ab82b325b934 100644 --- a/modules/channel/chain/dap_stream_ch_chain.c +++ b/modules/channel/chain/dap_stream_ch_chain.c @@ -1002,8 +1002,8 @@ void s_stream_ch_packet_in(dap_stream_ch_t* a_ch, void* a_arg) // Response with atom hashes and sizes case DAP_STREAM_CH_CHAIN_PKT_TYPE_UPDATE_CHAINS :{ - uint l_count_added=0; - uint l_count_total=0; + unsigned int l_count_added=0; + unsigned int l_count_total=0; dap_chain_t * l_chain = dap_chain_find_by_id(l_chain_pkt->hdr.net_id, l_chain_pkt->hdr.chain_id); if (! l_chain){ diff --git a/modules/net/CMakeLists.txt b/modules/net/CMakeLists.txt index 4085114464c3c8402f4581a3bc27ad5551eb0b02..4c05cea61e5af5c5a8710ee0c20c5a9904af0c74 100644 --- a/modules/net/CMakeLists.txt +++ b/modules/net/CMakeLists.txt @@ -37,7 +37,7 @@ endif() add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_NET_SRCS} ${DAP_CHAIN_NET_HEADERS} ${IPUTILS_SRCS} ${IPUTILS_HEADERS}) if(WIN32) - target_link_libraries(dap_core dap_chain_net dap_crypto dap_client dap_server_core dap_stream_ch_chain dap_stream_ch_chain_net dap_stream_ch_chain_net_srv dap_chain dap_chain_wallet dap_chain_net_srv + target_link_libraries(${PROJECT_NAME} dap_core dap_crypto dap_client dap_server_core dap_notify_srv dap_stream_ch_chain dap_stream_ch_chain_net dap_stream_ch_chain_net_srv dap_chain dap_chain_wallet dap_chain_net_srv dap_chain_mempool dap_chain_global_db dap_chain_cs_none) endif()