&& total_dgram_size < min_dpl) {
size_t deficit = min_dpl - total_dgram_size;
+ if (!ossl_assert(!pkt[first_el].h.done_implicit))
+ goto out;
+
if (!txp_pkt_append_padding(&pkt[first_el], txp, deficit))
goto out;
+
+ /*
+ * Padding frames make a packet ineligible for being a non-inflight
+ * packet.
+ */
+ pkt[first_el].tpkt->ackm_pkt.is_inflight = 1;
}
}
QUIC_SSTREAM *sstream,
QUIC_TXFC *stream_txfc,
QUIC_STREAM *next_stream,
- size_t min_ppl,
int *have_ack_eliciting,
int *packet_full,
uint64_t *new_credit_consumed)
WPACKET *wpkt;
QUIC_TXPIM_CHUNK chunk;
size_t i, j, space_left;
- int needs_padding_if_implicit, can_fill_payload, use_explicit_len;
+ int can_fill_payload, use_explicit_len;
int could_have_following_chunk;
uint64_t orig_len;
uint64_t hdr_len_implicit, payload_len_implicit;
goto err; /* can't fit anything */
}
- /*
- * If using the implicit-length representation would need padding, we
- * can't use it.
- */
- needs_padding_if_implicit = (h->bytes_appended + hdr_len_implicit
- + payload_len_implicit < min_ppl);
-
/*
* If there is a next stream, we don't use the implicit length so we can
* add more STREAM frames after this one, unless there is enough data
/* Choose between explicit or implicit length representations. */
use_explicit_len = !((can_fill_payload || !could_have_following_chunk)
- && !needs_padding_if_implicit);
+ && !pkt->force_pad);
if (use_explicit_len) {
/*
static int txp_generate_stream_related(OSSL_QUIC_TX_PACKETISER *txp,
struct txp_pkt *pkt,
- size_t min_ppl,
int *have_ack_eliciting,
QUIC_STREAM **tmp_head)
{
if (!txp_generate_stream_frames(txp, pkt,
stream->id, stream->sstream,
&stream->txfc,
- snext, min_ppl,
+ snext,
have_ack_eliciting,
&packet_full,
&stream->txp_txfc_new_credit_consumed)) {
QUIC_CFQ_ITEM *cfq_item;
QUIC_TXPIM_PKT *tpkt = NULL;
struct tx_helper *h = &pkt->h;
- size_t min_ppl = 0;
/* Maximum PN reached? */
if (!ossl_quic_pn_valid(txp->next_pn[pn_space]))
/* Stream-specific frames */
if (a.allow_stream_rel && txp->handshake_complete)
- if (!txp_generate_stream_related(txp, pkt, min_ppl,
+ if (!txp_generate_stream_related(txp, pkt,
&have_ack_eliciting,
&pkt->stream_head))
goto fatal_err;
have_ack_eliciting = 1;
}
- /* PADDING */
- if (a.allow_padding && h->bytes_appended < min_ppl) {
- WPACKET *wpkt = tx_helper_begin(h);
- if (wpkt == NULL)
- goto fatal_err;
-
- if (!ossl_quic_wire_encode_padding(wpkt, min_ppl - h->bytes_appended)
- || !tx_helper_commit(h))
- goto fatal_err;
-
- can_be_non_inflight = 0;
- }
+ /* PADDING is added by ossl_quic_tx_packetiser_generate(). */
/*
* ACKM Data