#define QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS (1U << 2) /* HANDSHAKE_DONE must be sent */
#define QUIC_FL_CONN_LISTENER (1U << 3)
#define QUIC_FL_CONN_ACCEPT_REGISTERED (1U << 4)
-#define QUIC_FL_CONN_TX_MUX_CONTEXT (1U << 5) /* sending in progress from the MUX layer */
+/* gap here */
#define QUIC_FL_CONN_IDLE_TIMER_RESTARTED_AFTER_READ (1U << 6)
#define QUIC_FL_CONN_RETRANS_NEEDED (1U << 7)
#define QUIC_FL_CONN_RETRANS_OLD_DATA (1U << 8) /* retransmission in progress for probing with already sent data */
_(QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS,
_(QUIC_FL_CONN_LISTENER,
_(QUIC_FL_CONN_ACCEPT_REGISTERED,
- _(QUIC_FL_CONN_TX_MUX_CONTEXT,
_(QUIC_FL_CONN_IDLE_TIMER_RESTARTED_AFTER_READ,
_(QUIC_FL_CONN_RETRANS_NEEDED,
_(QUIC_FL_CONN_RETRANS_OLD_DATA,
_(QUIC_FL_CONN_EXP_TIMER,
_(QUIC_FL_CONN_CLOSING,
_(QUIC_FL_CONN_DRAINING,
- _(QUIC_FL_CONN_IMMEDIATE_CLOSE)))))))))))))))))))))))));
+ _(QUIC_FL_CONN_IMMEDIATE_CLOSE))))))))))))))))))))))));
/* epilogue */
_(~0U);
return buf;
qcc->app_ops->detach(qcs);
/* Release qc_stream_desc buffer from quic-conn layer. */
- qc_stream_desc_release(qcs->stream, qcs->tx.fc.off_real);
+ if (qcs->stream) {
+ qc_stream_desc_sub_send(qcs->stream, NULL);
+ qc_stream_desc_release(qcs->stream, qcs->tx.fc.off_real);
+ }
/* Free Rx buffer. */
qcs_free_ncbuf(qcs, &qcs->rx.ncbuf);
/* check if the STREAM frame has already been notified. It can happen
* for retransmission.
*/
- if (offset + data < qcs->tx.fc.off_real) {
+ if (offset + data < qcs->tx.fc.off_real ||
+ (!data && (!(qcs->flags & QC_SF_FIN_STREAM) || qc_stream_buf_get(qcs->stream) || qcs_prep_bytes(qcs)))) {
TRACE_DEVEL("offset already notified", QMUX_EV_QCS_SEND, qcc->conn, qcs);
goto out;
}
}
/* Mark the stream descriptor <stream> as released. It will be freed as soon as
- * all its buffered data are acknowledged. Does nothing if <stream> is already
- * NULL.
+ * all its buffered data are acknowledged.
*
* <final_size> corresponds to the last offset sent for this stream. If there
* is unsent data present, they will be remove first to guarantee that buffer
void qc_stream_desc_release(struct qc_stream_desc *stream,
uint64_t final_size)
{
- if (!stream)
- return;
-
/* A stream can be released only one time. */
BUG_ON(stream->flags & QC_SD_FL_RELEASE);
}
TRACE_STATE("preparing data (from MUX)", QUIC_EV_CONN_TXPKT, qc);
- qc->flags |= QUIC_FL_CONN_TX_MUX_CONTEXT;
qel_register_send(&send_list, qc->ael, frms);
ret = qc_send(qc, 0, &send_list);
- qc->flags &= ~QUIC_FL_CONN_TX_MUX_CONTEXT;
TRACE_LEAVE(QUIC_EV_CONN_TXPKT, qc);
return ret;
LIST_DEL_INIT(&cf->list);
LIST_APPEND(outlist, &cf->list);
- /* Do not notify MUX on retransmission. */
- if (qc->flags & QUIC_FL_CONN_TX_MUX_CONTEXT) {
- qc_stream_desc_send(cf->stream.stream,
- cf->stream.offset.key,
- cf->stream.len);
- }
+ qc_stream_desc_send(cf->stream.stream,
+ cf->stream.offset.key,
+ cf->stream.len);
}
else {
struct quic_frame *new_cf;
cf->stream.offset.key += dlen;
cf->stream.data = (unsigned char *)b_peek(&cf_buf, dlen);
- /* Do not notify MUX on retransmission. */
- if (qc->flags & QUIC_FL_CONN_TX_MUX_CONTEXT) {
- qc_stream_desc_send(new_cf->stream.stream,
- new_cf->stream.offset.key,
- new_cf->stream.len);
- }
+ qc_stream_desc_send(new_cf->stream.stream,
+ new_cf->stream.offset.key,
+ new_cf->stream.len);
}
/* TODO the MUX is notified about the frame sending via