Tick connection on want_datagram_write (#314)

* Tick connection on datagram write

* Check that a connection can send before marking connection tickable
This commit is contained in:
Sam Hurst 2022-04-23 20:53:40 +01:00 committed by GitHub
parent 454939cdf8
commit dbc62fc9fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2900,8 +2900,12 @@ ietf_full_conn_ci_want_datagram_write (struct lsquic_conn *lconn, int is_want)
if (conn->ifc_flags & IFC_DATAGRAMS)
{
old = !!(conn->ifc_mflags & MF_WANT_DATAGRAM_WRITE);
if (is_want)
if (is_want) {
conn->ifc_mflags |= MF_WANT_DATAGRAM_WRITE;
if (lsquic_send_ctl_can_send (&conn->ifc_send_ctl))
lsquic_engine_add_conn_to_tickable(conn->ifc_enpub,
&conn->ifc_conn);
}
else
conn->ifc_mflags &= ~MF_WANT_DATAGRAM_WRITE;
LSQ_DEBUG("turn %s \"want datagram write\" flag",