Fix: calculate TLP timer correctly when only one packet is in flight

This commit is contained in:
Dmitri Tikhonov 2020-11-17 11:11:19 -05:00
parent 4c9d8eb069
commit 6f2daf28d8
4 changed files with 4 additions and 2 deletions

View file

@ -62,6 +62,7 @@ struct lsquic_conn_public {
*/
unsigned bytes_in; /* successfully processed */
unsigned bytes_out;
unsigned max_peer_ack_usec;
};
#endif

View file

@ -617,6 +617,7 @@ new_conn_common (lsquic_cid_t cid, struct lsquic_engine_public *enpub,
conn->fc_pub.packet_out_malo =
lsquic_malo_create(sizeof(struct lsquic_packet_out));
conn->fc_pub.path = &conn->fc_path;
conn->fc_pub.max_peer_ack_usec = ACK_TIMEOUT;
conn->fc_stream_ifs[STREAM_IF_STD].stream_if = enpub->enp_stream_if;
conn->fc_stream_ifs[STREAM_IF_STD].stream_if_ctx = enpub->enp_stream_if_ctx;
conn->fc_settings = &enpub->enp_settings;

View file

@ -3078,7 +3078,7 @@ handshake_ok (struct lsquic_conn *lconn)
conn->ifc_flags |= IFC_TIMESTAMPS;
}
conn->ifc_max_peer_ack_usec = params->tp_max_ack_delay * 1000;
conn->ifc_pub.max_peer_ack_usec = params->tp_max_ack_delay * 1000;
if ((params->tp_set & (1 << TPI_MAX_PACKET_SIZE))
&& params->tp_numerics[TPI_MAX_PACKET_SIZE]

View file

@ -415,7 +415,7 @@ calculate_tlp_delay (lsquic_send_ctl_t *ctl)
}
else
{
delay = srtt + srtt / 2 + MIN_RTO_DELAY;
delay = srtt + srtt / 2 + ctl->sc_conn_pub->max_peer_ack_usec;
if (delay < 2 * srtt)
delay = 2 * srtt;
}