From f094b9cabb9c4f6a77420f1824006dde58dbf3d1 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Wed, 8 Apr 2026 19:05:45 +0300 Subject: [PATCH] 1 --- src/etcp.c | 10 +++------- src/etcp_loadbalancer.c | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/etcp.c b/src/etcp.c index 31393cb..ad5a1ab 100644 --- a/src/etcp.c +++ b/src/etcp.c @@ -700,7 +700,7 @@ static void etcp_conn_process_send_queue(struct ETCP_CONN* etcp) {// вызыв char l_status[256]={0}; struct ETCP_LINK* link = etcp->links; while (link) { - snprintf (l_status+strlen(l_status), 256-strlen(l_status), "L%d%d%c ", link->recv_keepalive, link->remote_keepalive, (link->shaper_timer==0)?'R':'W'); + snprintf (l_status+strlen(l_status), 256-strlen(l_status), "L%d%d%s,%s ", link->recv_keepalive, link->remote_keepalive, (link->shaper_timer==0)?"wait":"rdy", link->send_blocked_inflight?"inf_block":"rdy"); link = link->next; } @@ -763,6 +763,7 @@ struct ETCP_DGRAM* etcp_request_pkt(struct ETCP_CONN* etcp) { inf_pkt->last_link->total_retransmissions++; inf_pkt->last_link->inflight_bytes -= inf_pkt->ll.len; inf_pkt->last_link->inflight_packets--; + if (link->send_blocked_inflight && link->inflight_bytes < link->inflight_lim_bytes) loadbalancer_link_ready(link); } // Always add to the CURRENT link (first send or retransmission) @@ -970,14 +971,9 @@ void etcp_ack_recv(struct ETCP_CONN* etcp, uint32_t seq, uint16_t ts, uint16_t d // === NEW: subtract inflight from the LAST link the packet was sent on === if (acked_pkt->last_link) { -// if (acked_pkt->last_link->inflight_bytes >= acked_pkt->ll.len) { acked_pkt->last_link->inflight_bytes -= acked_pkt->ll.len; -// } else { -// acked_pkt->last_link->inflight_bytes = 0; -// } -// if (acked_pkt->last_link->inflight_packets > 0) { acked_pkt->last_link->inflight_packets--; -// } + if (acked_pkt->last_link->send_blocked_inflight && acked_pkt->last_link->inflight_bytes < acked_pkt->last_link->inflight_lim_bytes) loadbalancer_link_ready(acked_pkt->last_link); } diff --git a/src/etcp_loadbalancer.c b/src/etcp_loadbalancer.c index 02b1db6..324f606 100644 --- a/src/etcp_loadbalancer.c +++ b/src/etcp_loadbalancer.c @@ -45,7 +45,7 @@ struct ETCP_LINK* etcp_loadbalancer_select_link(struct ETCP_CONN* etcp) { // link_index, link, link->initialized, link->shaper_timer==NULL?1:0, // (unsigned long long)link->shaper_load_time_tb, (unsigned long long)link->shaper_sub_nanotime); - if (!link->initialized || link->link_status != 1) { + if (!link->initialized || link->link_status != 1) {// link up/down link = link->next; continue; }