|
|
|
|
@ -580,7 +580,8 @@ static void ack_timeout_check(struct ETCP_CONN* etcp) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
current = etcp->input_wait_ack->head; |
|
|
|
|
} |
|
|
|
|
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); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
while(dgram = etcp_request_pkt(etcp)) { |
|
|
|
|
dgram = etcp_request_pkt(etcp); |
|
|
|
|
while(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
|
|
|
|
|
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++; |
|
|
|
|
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) ) { |
|
|
|
|
etcp->cnt_ack_hit_sndq++; |
|
|
|
|
queue_remove_data(etcp->input_send_q, (struct ll_entry*)acked_pkt); |
|
|
|
|
else { |
|
|
|
|
acked_pkt = (struct INFLIGHT_PACKET*)queue_find_data_by_id(etcp->input_send_q, seq); |
|
|
|
|
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) { |
|
|
|
|
// Packet might be already acknowledged or not found
|
|
|
|
|
|