summaryrefslogtreecommitdiffstats
path: root/src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_rtb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_rtb.c')
-rw-r--r--src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_rtb.c54
1 files changed, 44 insertions, 10 deletions
diff --git a/src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_rtb.c b/src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_rtb.c
index 6308261..5ebdce7 100644
--- a/src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_rtb.c
+++ b/src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_rtb.c
@@ -237,7 +237,7 @@ static ngtcp2_ssize rtb_reclaim_frame(ngtcp2_rtb *rtb, uint8_t flags,
switch (frc->fr.type) {
case NGTCP2_FRAME_STREAM:
strm = ngtcp2_conn_find_stream(conn, fr->stream.stream_id);
- if (strm == NULL) {
+ if (strm == NULL || (strm->flags & NGTCP2_STRM_FLAG_RESET_STREAM)) {
continue;
}
@@ -339,26 +339,60 @@ static ngtcp2_ssize rtb_reclaim_frame(ngtcp2_rtb *rtb, uint8_t flags,
return rv;
}
- break;
+ ++num_reclaimed;
+
+ nfrc->next = *pfrc;
+ *pfrc = nfrc;
+ pfrc = &nfrc->next;
+
+ continue;
case NGTCP2_FRAME_DATAGRAM:
case NGTCP2_FRAME_DATAGRAM_LEN:
continue;
- default:
- rv = ngtcp2_frame_chain_objalloc_new(&nfrc, rtb->frc_objalloc);
- if (rv != 0) {
- return rv;
+ case NGTCP2_FRAME_RESET_STREAM:
+ strm = ngtcp2_conn_find_stream(conn, fr->reset_stream.stream_id);
+ if (strm == NULL || !ngtcp2_strm_require_retransmit_reset_stream(strm)) {
+ continue;
}
- nfrc->fr = *fr;
+ break;
+ case NGTCP2_FRAME_STOP_SENDING:
+ strm = ngtcp2_conn_find_stream(conn, fr->stop_sending.stream_id);
+ if (strm == NULL || !ngtcp2_strm_require_retransmit_stop_sending(strm)) {
+ continue;
+ }
- rv = ngtcp2_bind_frame_chains(frc, nfrc, rtb->mem);
- if (rv != 0) {
- return rv;
+ break;
+ case NGTCP2_FRAME_MAX_STREAM_DATA:
+ strm = ngtcp2_conn_find_stream(conn, fr->max_stream_data.stream_id);
+ if (strm == NULL || !ngtcp2_strm_require_retransmit_max_stream_data(
+ strm, &fr->max_stream_data)) {
+ continue;
+ }
+
+ break;
+ case NGTCP2_FRAME_STREAM_DATA_BLOCKED:
+ strm = ngtcp2_conn_find_stream(conn, fr->stream_data_blocked.stream_id);
+ if (strm == NULL || !ngtcp2_strm_require_retransmit_stream_data_blocked(
+ strm, &fr->stream_data_blocked)) {
+ continue;
}
break;
}
+ rv = ngtcp2_frame_chain_objalloc_new(&nfrc, rtb->frc_objalloc);
+ if (rv != 0) {
+ return rv;
+ }
+
+ nfrc->fr = *fr;
+
+ rv = ngtcp2_bind_frame_chains(frc, nfrc, rtb->mem);
+ if (rv != 0) {
+ return rv;
+ }
+
++num_reclaimed;
nfrc->next = *pfrc;