Fix: IETF mini conn not tickable if can't send due to amplification

This commit is contained in:
Dmitri Tikhonov 2020-05-06 10:04:32 -04:00
parent 10f94146d0
commit 780fa2c574

View file

@ -46,6 +46,9 @@ static const struct conn_iface mini_conn_ietf_iface;
static unsigned highest_bit_set (unsigned long long); static unsigned highest_bit_set (unsigned long long);
static int
imico_can_send (const struct ietf_mini_conn *, size_t);
static const enum header_type el2hety[] = static const enum header_type el2hety[] =
{ {
@ -625,11 +628,15 @@ ietf_mini_conn_ci_is_tickable (struct lsquic_conn *lconn)
{ {
struct ietf_mini_conn *const conn = (struct ietf_mini_conn *) lconn; struct ietf_mini_conn *const conn = (struct ietf_mini_conn *) lconn;
const struct lsquic_packet_out *packet_out; const struct lsquic_packet_out *packet_out;
size_t packet_size;
if (conn->imc_enpub->enp_flags & ENPUB_CAN_SEND) if (conn->imc_enpub->enp_flags & ENPUB_CAN_SEND)
TAILQ_FOREACH(packet_out, &conn->imc_packets_out, po_next) TAILQ_FOREACH(packet_out, &conn->imc_packets_out, po_next)
if (!(packet_out->po_flags & PO_SENT)) if (!(packet_out->po_flags & PO_SENT))
return 1; {
packet_size = lsquic_packet_out_total_sz(lconn, packet_out);
return imico_can_send(conn, packet_size + IQUIC_TAG_LEN);
}
return 0; return 0;
} }