Remove already acknowledged CRYPTO
even if it has NGTCP2_RTB_FLAG_CRYPTO_TIMEOUT_RETRANSMITTED is set.
@@ -577,15 +577,12 @@ int ngtcp2_rtb_on_crypto_timeout(ngtcp2_rtb *rtb, ngtcp2_frame_chain **pfrc) {
for (; !ngtcp2_ksl_it_end(&it);) {
ent = ngtcp2_ksl_it_get(&it);
- if ((ent->flags & (NGTCP2_RTB_FLAG_CRYPTO_TIMEOUT_RETRANSMITTED |
- NGTCP2_RTB_FLAG_PROBE)) ||
+ if ((ent->flags & NGTCP2_RTB_FLAG_PROBE) ||
!(ent->flags & NGTCP2_RTB_FLAG_CRYPTO_PKT)) {
ngtcp2_ksl_it_next(&it);
continue;
}
- ent->flags |= NGTCP2_RTB_FLAG_CRYPTO_TIMEOUT_RETRANSMITTED;
-
all_acked = 1;
for (frc = ent->frc; frc; frc = frc->next) {
@@ -608,6 +605,7 @@ int ngtcp2_rtb_on_crypto_timeout(ngtcp2_rtb *rtb, ngtcp2_frame_chain **pfrc) {
all_acked = 0;
+ if (!(ent->flags & NGTCP2_RTB_FLAG_CRYPTO_TIMEOUT_RETRANSMITTED)) {
rv = ngtcp2_crypto_frame_chain_new(&nfrc, rtb->mem);
if (rv != 0) {
return rv;
@@ -616,6 +614,7 @@ int ngtcp2_rtb_on_crypto_timeout(ngtcp2_rtb *rtb, ngtcp2_frame_chain **pfrc) {
ngtcp2_crypto_frame_chain_copy(nfrc, (ngtcp2_crypto_frame_chain *)frc);
frame_chain_insert(pfrc, &nfrc->frc);
}
+ }
if (all_acked) {
/* If the frames that ent contains have been acknowledged,
@@ -627,6 +626,8 @@ int ngtcp2_rtb_on_crypto_timeout(ngtcp2_rtb *rtb, ngtcp2_frame_chain **pfrc) {
continue;
}
+ ent->flags |= NGTCP2_RTB_FLAG_CRYPTO_TIMEOUT_RETRANSMITTED;
+
ngtcp2_ksl_it_next(&it);
}
