};
#define QC_SF_NONE 0x00000000
-#define QC_SF_FIN_STREAM 0x00000001 // FIN bit must be set for last frame of the stream
-#define QC_SF_BLK_MROOM 0x00000002 // app layer is blocked waiting for room in the qcs.tx.buf
-#define QC_SF_DETACH 0x00000004 // cs is detached but there is remaining data to send
+#define QC_SF_FIN_RECV 0x00000001 // last frame received for this stream
+#define QC_SF_FIN_STREAM 0x00000002 // FIN bit must be set for last frame of the stream
+#define QC_SF_BLK_MROOM 0x00000004 // app layer is blocked waiting for room in the qcs.tx.buf
+#define QC_SF_DETACH 0x00000008 // cs is detached but there is remaining data to send
struct qcs {
struct qcc *qcc;
struct qcs *strm;
struct eb64_node *strm_node;
struct quic_rx_strm_frm *frm;
- char fin = 0;
strm_node = qcc_get_qcs(qc->qcc, strm_frm->id);
if (!strm_node) {
strm_frm->data += diff;
}
+ BUG_ON(strm->flags & QC_SF_FIN_RECV);
+
total = 0;
if (strm_frm->offset.key == strm->rx.offset) {
int ret;
total += qc_treat_rx_strm_frms(strm);
/* FIN is set only if all data were copied. */
- fin = strm_frm->fin && !strm_frm->len;
- if (total && qc->qcc->app_ops->decode_qcs(strm, fin, qc->qcc->ctx) < 0) {
+ if (strm_frm->fin && !strm_frm->len)
+ strm->flags |= QC_SF_FIN_RECV;
+
+ if (total && qc->qcc->app_ops->decode_qcs(strm, strm->flags & QC_SF_FIN_RECV, qc->qcc->ctx) < 0) {
TRACE_PROTO("Decoding error", QUIC_EV_CONN_PSTRM, qc);
return 0;
}