net/tcp: add a member to record the current receiving window

Change-Id: Ic4c46d643a905fdd3a828e563eab4814da70dbe5
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2020-12-07 14:12:59 +08:00 committed by Masayuki Ishikawa
parent 794a6ec23d
commit 881dd9d62d
3 changed files with 9 additions and 0 deletions

View File

@ -263,6 +263,10 @@ static int sixlowpan_tcp_header(FAR struct tcp_conn_s *conn,
ipv6tcp->tcp.wnd[0] = recvwndo >> 8;
ipv6tcp->tcp.wnd[1] = recvwndo & 0xff;
/* Update the Receiver Window */
conn->rcv_wnd = recvwndo;
}
/* Calculate TCP checksum. */

View File

@ -194,6 +194,7 @@ struct tcp_conn_s
* connection */
uint16_t snd_wnd; /* Sequence and acknowledgement numbers of last
* window update */
uint16_t rcv_wnd; /* Receiver window available */
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
uint32_t tx_unacked; /* Number bytes sent but not yet ACKed */
#else

View File

@ -366,6 +366,10 @@ static void tcp_sendcommon(FAR struct net_driver_s *dev,
tcp->wnd[0] = recvwndo >> 8;
tcp->wnd[1] = recvwndo & 0xff;
/* Update the Receiver Window */
conn->rcv_wnd = recvwndo;
}
/* Finish the IP portion of the message and calculate checksums */