Browse Source

-warn

nodeinfo-routing-update
Evgeny 1 week ago
parent
commit
8030161ea6
  1. 3
      lib/u_async.c
  2. 22
      src/etcp.c
  3. 1
      src/secure_channel.c

3
lib/u_async.c

@ -941,7 +941,8 @@ void uasync_poll(struct UASYNC* ua, int timeout_tb) {
#ifdef _WIN32 #ifdef _WIN32
Sleep(timeout_ms); Sleep(timeout_ms);
#else #else
usleep(timeout_ms * 1000); struct timespec ts = { timeout_ms / 1000, (timeout_ms % 1000) * 1000000 };
nanosleep(&ts, NULL);
#endif #endif
} }
process_timeouts(ua); process_timeouts(ua);

22
src/etcp.c

@ -580,7 +580,8 @@ static void ack_timeout_check(struct ETCP_CONN* etcp) {
struct ll_entry* current; struct ll_entry* current;
while (current = etcp->input_wait_ack->head) { current = etcp->input_wait_ack->head;
while (current) {
struct INFLIGHT_PACKET* pkt = (struct INFLIGHT_PACKET*)current; struct INFLIGHT_PACKET* pkt = (struct INFLIGHT_PACKET*)current;
int64_t elapsed = now - pkt->last_timestamp; int64_t elapsed = now - pkt->last_timestamp;
@ -611,6 +612,7 @@ static void ack_timeout_check(struct ETCP_CONN* etcp) {
DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "[%s] retransmission timer set for %llu units", etcp->log_name, next_timeout); DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "[%s] retransmission timer set for %llu units", etcp->log_name, next_timeout);
return; return;
} }
current = etcp->input_wait_ack->head;
} }
queue_resume_callback(etcp->input_wait_ack); queue_resume_callback(etcp->input_wait_ack);
} }
@ -696,8 +698,10 @@ static void etcp_conn_process_send_queue(struct ETCP_CONN* etcp) {// вызыв
DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "[%s] TX state: %d (link not ready, skip send)", etcp->log_name, etcp->tx_state); DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "[%s] TX state: %d (link not ready, skip send)", etcp->log_name, etcp->tx_state);
return; return;
} }
while(dgram = etcp_request_pkt(etcp)) { dgram = etcp_request_pkt(etcp);
while(dgram) {
etcp_loadbalancer_send(dgram); etcp_loadbalancer_send(dgram);
dgram = etcp_request_pkt(etcp);
} }
} }
@ -933,15 +937,19 @@ void etcp_ack_recv(struct ETCP_CONN* etcp, uint32_t seq, uint16_t ts, uint16_t d
// Find the acknowledged packet in the wait_ack queue // Find the acknowledged packet in the wait_ack queue
struct INFLIGHT_PACKET* acked_pkt; struct INFLIGHT_PACKET* acked_pkt;
if (acked_pkt = (struct INFLIGHT_PACKET*)queue_find_data_by_id(etcp->input_wait_ack, seq)) { acked_pkt = (struct INFLIGHT_PACKET*)queue_find_data_by_id(etcp->input_wait_ack, seq);
if (acked_pkt) {
etcp->cnt_ack_hit_inf++; etcp->cnt_ack_hit_inf++;
queue_remove_data(etcp->input_wait_ack, (struct ll_entry*)acked_pkt); queue_remove_data(etcp->input_wait_ack, (struct ll_entry*)acked_pkt);
} }
else if ( acked_pkt = (struct INFLIGHT_PACKET*)queue_find_data_by_id(etcp->input_send_q, seq) ) { else {
etcp->cnt_ack_hit_sndq++; acked_pkt = (struct INFLIGHT_PACKET*)queue_find_data_by_id(etcp->input_send_q, seq);
queue_remove_data(etcp->input_send_q, (struct ll_entry*)acked_pkt); if (acked_pkt) {
etcp->cnt_ack_hit_sndq++;
queue_remove_data(etcp->input_send_q, (struct ll_entry*)acked_pkt);
} }
else etcp->cnt_ack_miss++; else etcp->cnt_ack_miss++;
}
if (!acked_pkt) { if (!acked_pkt) {
// Packet might be already acknowledged or not found // Packet might be already acknowledged or not found

1
src/secure_channel.c

@ -24,6 +24,7 @@
// The core logic (e.g., nonce building, CRC, session key derivation as memcpy, counters, etc.) remains unchanged. // The core logic (e.g., nonce building, CRC, session key derivation as memcpy, counters, etc.) remains unchanged.
#ifdef USE_OPENSSL #ifdef USE_OPENSSL
#include <openssl/bn.h>
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/ec.h> #include <openssl/ec.h>
#include <openssl/rand.h> #include <openssl/rand.h>

Loading…
Cancel
Save