diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b89ff657f2a48c2a8e5c5d331a6e915eff0a25d..f4d093567250ce9e2bdce8181cb932651d5398e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ project(cellframe-sdk C) cmake_minimum_required(VERSION 2.8) set(CMAKE_C_STANDARD 11) -set(CELLFRAME_SDK_NATIVE_VERSION "2.8-7") +set(CELLFRAME_SDK_NATIVE_VERSION "2.8-8") add_definitions ("-DCELLFRAME_SDK_VERSION=\"${CELLFRAME_SDK_NATIVE_VERSION}\"") set(DAPSDK_MODULES "") diff --git a/dap-sdk/crypto/src/sig_dilithium/dilithium_params.h b/dap-sdk/crypto/src/sig_dilithium/dilithium_params.h index 3461cfd09fea7406ccf24edf4b805ccea7fb1903..135a77e2ee8dbd86683baa81c4cf8f59c55e1241 100755 --- a/dap-sdk/crypto/src/sig_dilithium/dilithium_params.h +++ b/dap-sdk/crypto/src/sig_dilithium/dilithium_params.h @@ -27,7 +27,7 @@ ///======================================================================== /* Names for the four varieties of Dilithium */ -typedef enum { MODE_0, MODE_1, MODE_2, MODE_3 } __attribute__((aligned(8))) dilithium_kind_t; +typedef enum { MODE_0, MODE_1, MODE_2, MODE_3 } __attribute__((aligned(4))) dilithium_kind_t; typedef struct { dilithium_kind_t kind; /* the kind of Dilithium (i.e. *this* choice of parameters) */ diff --git a/dap-sdk/net/client/dap_client_http.c b/dap-sdk/net/client/dap_client_http.c index 2f09c8536b1e416c1302fae7f5d7aa4dad51c3c7..1b800771f7836e267ce910c5ca739b8e1f60b9c3 100644 --- a/dap-sdk/net/client/dap_client_http.c +++ b/dap-sdk/net/client/dap_client_http.c @@ -127,7 +127,7 @@ static bool s_timer_timeout_check(void * a_arg) if(dap_events_socket_check_unsafe(l_worker, l_es) ){ if (!dap_uint128_check_equal(l_es->uuid,l_es_handler->uuid)){ // Timer esocket wrong argument, ignore this timeout... - DAP_DELETE(l_es_handler); + DAP_DEL_Z(l_es_handler) return false; } dap_client_http_pvt_t * l_http_pvt = PVT(l_es); @@ -141,10 +141,8 @@ static bool s_timer_timeout_check(void * a_arg) log_it(L_INFO, "Close %s sock %u type %d by timeout", l_es->remote_addr_str ? l_es->remote_addr_str : "", l_es->socket, l_es->type); dap_events_socket_remove_and_delete_unsafe(l_es, true); - } else { - log_it(L_INFO, "Socket %d type %d already disposed", l_es->socket, l_es->type); } - DAP_DELETE(l_es_handler); + DAP_DEL_Z(l_es_handler) return false; } @@ -501,7 +499,10 @@ void* dap_client_http_request_custom(dap_worker_t * a_worker,const char *a_uplin log_it(L_DEBUG, "Connecting to %s:%u", a_uplink_addr, a_uplink_port); l_http_pvt->worker = a_worker?a_worker: dap_events_worker_get_auto(); dap_worker_add_events_socket(l_ev_socket,l_http_pvt->worker); - dap_timerfd_start_on_worker(l_http_pvt->worker,s_client_timeout_ms, s_timer_timeout_check,l_ev_socket); + dap_events_socket_handler_t * l_ev_socket_handler = DAP_NEW_Z(dap_events_socket_handler_t); + l_ev_socket_handler->esocket = l_ev_socket; + l_ev_socket_handler->uuid = l_ev_socket->uuid; + dap_timerfd_start_on_worker(l_http_pvt->worker,s_client_timeout_ms, s_timer_timeout_check,l_ev_socket_handler); return l_http_pvt; } else { log_it(L_ERROR, "Socket %d connecting error: %d", l_ev_socket->socket, l_err2); diff --git a/dap-sdk/net/core/dap_events_socket.c b/dap-sdk/net/core/dap_events_socket.c index d852b8c248716f1a34de1444566508aa3c861572..db6acb4d73ed63300c0a6cd30e87ff3ee90cda4b 100644 --- a/dap-sdk/net/core/dap_events_socket.c +++ b/dap-sdk/net/core/dap_events_socket.c @@ -158,7 +158,7 @@ dap_events_socket_t *dap_events_socket_wrap_no_add( dap_events_t *a_events, l_ret->buf_out = a_callbacks->timer_callback ? NULL : DAP_NEW_Z_SIZE(byte_t, l_ret->buf_out_size_max + 1); l_ret->buf_in_size = l_ret->buf_out_size = 0; #if defined(DAP_EVENTS_CAPS_EPOLL) - ret->ev_base_flags = EPOLLERR | EPOLLRDHUP | EPOLLHUP; + l_ret->ev_base_flags = EPOLLERR | EPOLLRDHUP | EPOLLHUP; #elif defined(DAP_EVENTS_CAPS_POLL) l_ret->poll_base_flags = POLLERR | POLLRDHUP | POLLHUP; #endif diff --git a/modules/net/dap_chain_net.c b/modules/net/dap_chain_net.c index 4173ca89b74486de0885650cbfef145c064fabaa..e6b664a6caea7ca646f941a1c4ad9bec55782f32 100644 --- a/modules/net/dap_chain_net.c +++ b/modules/net/dap_chain_net.c @@ -504,7 +504,6 @@ static void s_net_state_link_prepare_success(dap_worker_t * a_worker,dap_chain_n dap_proc_queue_add_callback_inter( a_worker->proc_queue_input,s_net_states_proc,l_net ); } - pthread_rwlock_unlock(&l_net_pvt->rwlock); l_dns_request->tries++; s_fill_links_from_root_aliases(l_net); @@ -512,6 +511,7 @@ static void s_net_state_link_prepare_success(dap_worker_t * a_worker,dap_chain_n if (l_net_pvt->links_dns_requests == 0){ // It was the last one } + pthread_rwlock_unlock(&l_net_pvt->rwlock); } /** @@ -527,6 +527,7 @@ static void s_net_state_link_prepare_error(dap_worker_t * a_worker,dap_chain_nod dap_chain_net_t * l_net = l_dns_request->net; dap_chain_net_pvt_t * l_net_pvt = PVT(l_net); + pthread_rwlock_unlock(&l_net_pvt->rwlock); l_net_pvt->links_dns_requests--; }