1
This commit is contained in:
1 parent
06323dbad1
commit
65714c405f
1 file changed
+6
-7
+6
-7
@@ -548,7 +548,7 @@ static void ack_timeout_check(struct ETCP_CONN* etcp) {
|
||||
uint64_t now = get_time_tb();
|
||||
uint64_t timeout = 1000;//(uint64_t)(etcp->rtt_avg_10 * RETRANS_K1) + (uint64_t)(etcp->jitter * RETRANS_K2);
|
||||
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "ack_timeout_check: starting check, now=%llu, timeout=%llu, rtt_avg_10=%u, jitter=%u",
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "starting check, now=%llu, timeout=%llu, rtt_avg_10=%u, jitter=%u",
|
||||
(unsigned long long)now, (unsigned long long)timeout, etcp->rtt_avg_10, etcp->jitter);
|
||||
|
||||
struct ll_entry* current;
|
||||
@@ -557,14 +557,13 @@ static void ack_timeout_check(struct ETCP_CONN* etcp) {
|
||||
|
||||
int64_t elapsed = now - pkt->last_timestamp;
|
||||
if (elapsed > timeout) {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_ETCP, "[%s] ack_timeout_check: timeout for seq=%u, elapsed=%llu, timeout=%llu, send_count=%u. Moving: wait_ack -> send_q",
|
||||
etcp->log_name, pkt->seq, (unsigned long long)elapsed, (unsigned long long)timeout, pkt->send_count);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_ETCP, "[%s] timeout for seq=%u, elapsed=%llu, now=%llu, timeout=%llu, send_count=%u. Moving: wait_ack -> send_q",
|
||||
etcp->log_name, pkt->seq, (unsigned long long)elapsed, (unsigned long long)now, (unsigned long long)timeout, pkt->send_count);
|
||||
|
||||
// Increment counters
|
||||
pkt->send_count++;
|
||||
pkt->retrans_req_count++; // Optional, if used for retrans request logic
|
||||
pkt->last_timestamp = now;
|
||||
pkt->last_link = NULL; // Reset last link for re-selection
|
||||
|
||||
// Remove from wait_ack
|
||||
queue_data_get(etcp->input_wait_ack);
|
||||
@@ -581,7 +580,7 @@ static void ack_timeout_check(struct ETCP_CONN* etcp) {
|
||||
int64_t next_timeout=timeout - elapsed;
|
||||
if (next_timeout<0) next_timeout=0;
|
||||
etcp->retrans_timer = uasync_set_timeout(etcp->instance->ua, next_timeout+10, etcp, ack_timeout_cb);
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "[%s] ack_timeout_check: 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;
|
||||
}
|
||||
}
|
||||
@@ -658,12 +657,12 @@ struct ETCP_DGRAM* etcp_request_pkt(struct ETCP_CONN* etcp) {
|
||||
size_t send_q_size = queue_entry_count(etcp->input_send_q);
|
||||
|
||||
if (send_q_size == 0) {// сгребаем из input_queue
|
||||
// DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "etcp_request_pkt: input_send_q empty, check if avail input_queue -> inflight");
|
||||
// DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "input_send_q empty, check if avail input_queue -> inflight");
|
||||
input_queue_try_push(etcp);
|
||||
}
|
||||
|
||||
// First, check if there's a packet in input_send_q (retrans or new)
|
||||
// DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "etcp_request_pkt: getting packet from input_send_q");
|
||||
// DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "getting packet from input_send_q");
|
||||
struct INFLIGHT_PACKET* inf_pkt = (struct INFLIGHT_PACKET*)queue_data_get(etcp->input_send_q);
|
||||
if (inf_pkt) {
|
||||
inf_pkt->last_timestamp=get_time_tb();
|
||||
|
||||
Reference in new issue
Block a user