return status;
}
-/* Retransmit up to two datagrams depending on packet number space */
-static void qc_dgrams_retransmit(struct quic_conn *qc)
+/* Retransmit up to two datagrams depending on packet number space.
+ * Return 0 when failed, 0 if not.
+ */
+static int qc_dgrams_retransmit(struct quic_conn *qc)
{
+ int ret = 0;
struct quic_enc_level *iqel = &qc->els[QUIC_TLS_ENC_LEVEL_INITIAL];
struct quic_enc_level *hqel = &qc->els[QUIC_TLS_ENC_LEVEL_HANDSHAKE];
struct quic_enc_level *aqel = &qc->els[QUIC_TLS_ENC_LEVEL_APP];
iqel->pktns->tx.pto_probe = 1;
if (!LIST_ISEMPTY(&hfrms))
hqel->pktns->tx.pto_probe = 1;
- qc_send_hdshk_pkts(qc, 1, QUIC_TLS_ENC_LEVEL_INITIAL, &ifrms,
- QUIC_TLS_ENC_LEVEL_HANDSHAKE, &hfrms);
+ if (!qc_send_hdshk_pkts(qc, 1, QUIC_TLS_ENC_LEVEL_INITIAL, &ifrms,
+ QUIC_TLS_ENC_LEVEL_HANDSHAKE, &hfrms))
+ goto leave;
/* Put back unsent frames in their packet number spaces */
LIST_SPLICE(&iqel->pktns->tx.frms, &ifrms);
LIST_SPLICE(&hqel->pktns->tx.frms, &hfrms);
TRACE_DEVEL("Avail. ack eliciting frames", QUIC_EV_CONN_FRMLIST, qc, &frms1);
if (!LIST_ISEMPTY(&frms1)) {
hqel->pktns->tx.pto_probe = 1;
- qc_send_hdshk_pkts(qc, 1, QUIC_TLS_ENC_LEVEL_HANDSHAKE, &frms1,
- QUIC_TLS_ENC_LEVEL_NONE, NULL);
+ if (!qc_send_hdshk_pkts(qc, 1, QUIC_TLS_ENC_LEVEL_HANDSHAKE, &frms1,
+ QUIC_TLS_ENC_LEVEL_NONE, NULL))
+ goto leave;
+
/* Put back unsent frames into their packet number spaces */
LIST_SPLICE(&hqel->pktns->tx.frms, &frms1);
}
TRACE_PROTO("Avail. ack eliciting frames", QUIC_EV_CONN_FRMLIST, qc, &frms2);
if (!LIST_ISEMPTY(&frms1)) {
aqel->pktns->tx.pto_probe = 1;
- qc_send_app_probing(qc, &frms1);
+ if (!qc_send_app_probing(qc, &frms1))
+ goto leave;
+
/* Put back unsent frames into their packet number spaces */
LIST_SPLICE(&aqel->pktns->tx.frms, &frms1);
}
if (!LIST_ISEMPTY(&frms2)) {
aqel->pktns->tx.pto_probe = 1;
- qc_send_app_probing(qc, &frms2);
+ if (!qc_send_app_probing(qc, &frms2))
+ goto leave;
/* Put back unsent frames into their packet number spaces */
LIST_SPLICE(&aqel->pktns->tx.frms, &frms2);
}
aqel->pktns->flags &= ~QUIC_FL_PKTNS_PROBE_NEEDED;
}
}
+
+ ret = 1;
+ leave:
TRACE_LEAVE(QUIC_EV_CONN_TXPKT, qc);
+ return ret;
}
/* QUIC connection packet handler task (post handshake) */
if (qc->flags & QUIC_FL_CONN_RETRANS_NEEDED) {
TRACE_STATE("retransmission needed", QUIC_EV_CONN_IO_CB, qc);
qc->flags &= ~QUIC_FL_CONN_RETRANS_NEEDED;
- qc_dgrams_retransmit(qc);
+ if (!qc_dgrams_retransmit(qc))
+ goto out;
}
if (!LIST_ISEMPTY(&qel->rx.pqpkts) && qc_qel_may_rm_hp(qc, qel))
if (qc->flags & QUIC_FL_CONN_RETRANS_NEEDED) {
TRACE_DEVEL("retransmission needed", QUIC_EV_CONN_PHPKTS, qc);
qc->flags &= ~QUIC_FL_CONN_RETRANS_NEEDED;
- qc_dgrams_retransmit(qc);
+ if (!qc_dgrams_retransmit(qc))
+ goto out;
}
ssl_err = SSL_ERROR_NONE;