net: tcp2: Retrigger resend if sending window is full

If we try to send data but the sending window is full, then
try to kick the resend of the pending data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2020-09-18 10:39:17 +03:00 committed by Anas Nashif
parent 69459507b6
commit 4e3060a26b

View File

@ -1434,6 +1434,13 @@ int net_tcp_queue_data(struct net_context *context, struct net_pkt *pkt)
k_mutex_lock(&conn->lock, K_FOREVER);
if (tcp_window_full(conn)) {
/* Trigger resend if the timer is not active */
if (!k_delayed_work_remaining_get(&conn->send_data_timer)) {
NET_DBG("Window full, trigger resend");
tcp_resend_data(
(struct k_work *)&conn->send_data_timer);
}
ret = -EAGAIN;
goto out;
}