void qel_register_send(struct list *send_list, struct quic_enc_level *qel,
struct list *frms);
-int qc_prep_hpkts(struct quic_conn *qc, struct buffer *buf, struct list *qels);
-int qc_send_ppkts(struct buffer *buf, struct ssl_sock_ctx *ctx);
+int qc_send_hdshk_pkts(struct quic_conn *qc, int old_data, struct list *send_list);
int qc_send_app_pkts(struct quic_conn *qc, struct list *frms);
+
int qc_dgrams_retransmit(struct quic_conn *qc);
void qc_prep_hdshk_fast_retrans(struct quic_conn *qc,
struct list *ifrms, struct list *hfrms);
/* QUIC connection packet handler task. */
struct task *quic_conn_io_cb(struct task *t, void *context, unsigned int state)
{
- int ret;
struct quic_conn *qc = context;
- struct buffer *buf = NULL;
struct list send_list = LIST_HEAD_INIT(send_list);
- struct quic_enc_level *qel, *tmp_qel;
+ struct quic_enc_level *qel;
int st;
struct tasklet *tl = (struct tasklet *)t;
list_for_each_entry(qel, &qc->qel_list, list)
qel_register_send(&send_list, qel, &qel->pktns->tx.frms);
- buf = qc_get_txb(qc);
- if (!buf)
- goto out;
-
- if (b_data(buf) && !qc_purge_txbuf(qc, buf))
+ if (!qc_send_hdshk_pkts(qc, 0, &send_list)) {
+ TRACE_DEVEL("qc_send_hdshk_pkts() failed", QUIC_EV_CONN_IO_CB, qc);
goto out;
-
- /* Currently buf cannot be non-empty at this stage. Even if a previous
- * sendto() has failed it is emptied to simulate packet emission and
- * rely on QUIC lost detection to try to emit it.
- */
- BUG_ON_HOT(b_data(buf));
- b_reset(buf);
-
- ret = qc_prep_hpkts(qc, buf, &send_list);
-
- /* Always reset QEL sending list. */
- list_for_each_entry_safe(qel, tmp_qel, &send_list, el_send) {
- LIST_DEL_INIT(&qel->el_send);
- qel->send_frms = NULL;
}
- if (ret == -1) {
- qc_txb_release(qc);
- goto out;
- }
-
- if (ret && !qc_send_ppkts(buf, qc->xprt_ctx)) {
- if (qc->flags & QUIC_FL_CONN_TO_KILL)
- qc_txb_release(qc);
- goto out;
- }
-
- qc_txb_release(qc);
-
out:
/* Release the Handshake encryption level and packet number space if
* the Handshake is confirmed and if there is no need to send
* Remaining data are purged from the buffer and will eventually be detected
* as lost which gives the opportunity to retry sending.
*/
-int qc_send_ppkts(struct buffer *buf, struct ssl_sock_ctx *ctx)
+static int qc_send_ppkts(struct buffer *buf, struct ssl_sock_ctx *ctx)
{
int ret = 0;
struct quic_conn *qc;
* Returns the number of bytes prepared in datragrams/packets if succeeded
* (may be 0), or -1 if something wrong happened.
*/
-int qc_prep_hpkts(struct quic_conn *qc, struct buffer *buf, struct list *qels)
+static int qc_prep_hpkts(struct quic_conn *qc, struct buffer *buf,
+ struct list *qels)
{
int ret, cc, padding;
struct quic_tx_packet *first_pkt, *prv_pkt;