Skip to content
Snippets Groups Projects
Commit cae0c091 authored by Roman Khlopkov's avatar Roman Khlopkov 🔜
Browse files

[*] Node client states sequence corrected

parent 40b2e8a6
No related branches found
No related tags found
No related merge requests found
Pipeline #35537 passed with stage
in 9 minutes and 35 seconds
......@@ -253,7 +253,15 @@ static void s_stage_connected_callback(dap_client_t *a_client, void *a_arg)
log_it(L_NOTICE, "Stream connection with node "NODE_ADDR_FP_STR" (%s:%hu) established",
NODE_ADDR_FP_ARGS_S(l_node_client->remote_node_addr),
l_ip_addr_str, l_node_client->info->hdr.ext_port);
// set callbacks for C and N channels; for R and S it is not needed
if (a_client->active_channels) {
size_t l_channels_count = dap_strlen(a_client->active_channels);
for(size_t i = 0; i < l_channels_count; i++) {
if(s_node_client_set_notify_callbacks(a_client, a_client->active_channels[i]) == -1) {
log_it(L_WARNING, "No ch_chain channel, can't init notify callback for pkt type CH_CHAIN");
}
}
}
if(l_node_client->callbacks.connected)
l_node_client->callbacks.connected(l_node_client, l_node_client->callbacks_arg);
dap_stream_ch_chain_net_pkt_hdr_t l_announce = { .version = DAP_STREAM_CH_CHAIN_NET_PKT_VERSION,
......@@ -266,7 +274,6 @@ static void s_stage_connected_callback(dap_client_t *a_client, void *a_arg)
log_it(L_DEBUG, "Wakeup all who waits");
dap_cond_signal(l_node_client->wait_cond);
pthread_mutex_unlock(&l_node_client->wait_mutex);
dap_stream_t * l_stream = dap_client_get_stream(a_client);
if (l_stream) {
l_node_client->esocket_uuid = l_stream->esocket->uuid;
......@@ -283,15 +290,6 @@ static void s_stage_connected_callback(dap_client_t *a_client, void *a_arg)
}
}
}
// set callbacks for C and N channels; for R and S it is not needed
if (a_client->active_channels) {
size_t l_channels_count = dap_strlen(a_client->active_channels);
for(size_t i = 0; i < l_channels_count; i++) {
if(s_node_client_set_notify_callbacks(a_client, a_client->active_channels[i]) == -1) {
log_it(L_WARNING, "No ch_chain channel, can't init notify callback for pkt type CH_CHAIN");
}
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment