goto err;
total = b_force_xfer(buf, payload, to_xfer);
+ /* FIN is positioned only when the buffer has been totally emptied. */
fin = fin && !b_data(payload);
frm->type = QUIC_FT_STREAM_8;
if (fin)
struct qcs *qcs = container_of(node, struct qcs, by_id);
struct buffer *buf = &qcs->tx.buf;
if (b_data(buf)) {
- char fin = 0;
-
- /* if FIN is activated, ensure the buffer to
- * send is the last
- */
- if (qcs->flags & QC_SF_FIN_STREAM) {
- BUG_ON(b_data(&qcs->tx.buf) < b_data(buf));
- fin = (b_data(&qcs->tx.buf) - b_data(buf) == 0);
- }
-
+ char fin = qcs->flags & QC_SF_FIN_STREAM;
ret = qcs_push_frame(qcs, buf, fin, qcs->tx.offset);
if (ret < 0)
ABORT_NOW();