diff --git a/dap-sdk/net/core/include/dap_events_socket.h b/dap-sdk/net/core/include/dap_events_socket.h index deb34092c49ab0c262b468c5e69713cf66565f81..66cf438a94aadee7dcabf4cec23c06a902a9a536 100644 --- a/dap-sdk/net/core/include/dap_events_socket.h +++ b/dap-sdk/net/core/include/dap_events_socket.h @@ -29,11 +29,10 @@ #include "uthash.h" #ifndef _WIN32 #include <sys/epoll.h> -#include <pthread.h> #else #include "wepoll.h" #endif - +#include <pthread.h> struct dap_events; struct dap_events_socket; struct dap_worker; diff --git a/modules/global-db/dap_chain_global_db_driver_cdb.c b/modules/global-db/dap_chain_global_db_driver_cdb.c index d6a19b116b4d09c61ef1858ac49c5f8b68fd977f..88221e95d522ec66d094e9a1011ea756c765a9ea 100644 --- a/modules/global-db/dap_chain_global_db_driver_cdb.c +++ b/modules/global-db/dap_chain_global_db_driver_cdb.c @@ -29,7 +29,6 @@ #include <sys/stat.h> #include <uthash.h> #define _GNU_SOURCE -#include <fnmatch.h> #include "dap_common.h" #include "dap_hash.h" @@ -472,9 +471,11 @@ dap_list_t* dap_db_driver_cdb_get_groups_by_mask(const char *a_group_mask) pthread_mutex_lock(&cdb_mutex); HASH_ITER(hh, s_cdb, cur_cdb, tmp) { - if(!fnmatch(a_group_mask, cur_cdb->local_group, 0)) - if(fnmatch("*.del", cur_cdb->local_group, 0)) + if(strstr(cur_cdb->local_group, a_group_mask)) { + if(!strstr(cur_cdb->local_group, ".del")) { l_ret_list = dap_list_prepend(l_ret_list, dap_strdup(cur_cdb->local_group)); + } + } } pthread_mutex_unlock(&cdb_mutex); return l_ret_list; diff --git a/modules/net/dap_chain_net.c b/modules/net/dap_chain_net.c index d97caf8915102a2c6e835410ef1704982326cd49..8a7357967f7e2ebef800c60e37327ba51a75b179 100644 --- a/modules/net/dap_chain_net.c +++ b/modules/net/dap_chain_net.c @@ -30,7 +30,6 @@ #include <stdint.h> #include <string.h> #include <errno.h> -#include <fnmatch.h> #ifdef DAP_OS_UNIX #include <sys/types.h> @@ -1259,7 +1258,7 @@ int s_net_load(const char * a_net_name) while(l_groups) { char *l_group_name = l_groups->data; // do not use groups with names like *.del - if(fnmatch("*.del", l_group_name, 0)) { + if(!strstr(l_group_name, ".del")) { const char *l_history_group = dap_chain_global_db_add_history_extra_group(l_group_name, PVT(l_net)->gdb_sync_nodes_addrs, PVT(l_net)->gdb_sync_nodes_addrs_count); dap_chain_global_db_add_history_extra_group_callback_notify(l_group_name, diff --git a/modules/net/dap_chain_node_client.c b/modules/net/dap_chain_node_client.c index ce016ffeaafab4a79f24cfa914f0b85ad882f2a1..572ad92622ac31c02226fc5e279c5486c38957e3 100644 --- a/modules/net/dap_chain_node_client.c +++ b/modules/net/dap_chain_node_client.c @@ -600,10 +600,11 @@ int dap_chain_node_client_wait(dap_chain_node_client_t *a_client, int a_waited_s if ( wait == WAIT_OBJECT_0 && ( a_client->state == a_waited_state || a_client->state == NODE_CLIENT_STATE_ERROR || a_client->state == NODE_CLIENT_STATE_DISCONNECTED - ) { + )) { ret = a_client->state == a_waited_state ? 0 : -2; break; } + else if ( wait == WAIT_TIMEOUT || wait == WAIT_FAILED ) { ret = -1; break;