struct sockaddr_storage *peer_addr,
int token, void *owner,
struct connection *conn);
-int quic_build_post_handshake_frames(struct quic_conn *qc);
+int quic_build_post_handshake_frames(struct quic_conn *qc,
+ struct list *to_frms_list);
const struct quic_version *qc_supported_version(uint32_t version);
int quic_peer_validated_addr(struct quic_conn *qc);
void qc_set_timer(struct quic_conn *qc);
return ret;
}
-/* Build all the frames which must be sent just after the handshake have succeeded.
+/* Build all the frames which must be sent just after the handshake have succeeded
+ * for server, or asap for client (0-RTT).
* This is essentially NEW_CONNECTION_ID frames. A QUIC server must also send
* a HANDSHAKE_DONE frame.
* Return 1 if succeeded, 0 if not.
*/
-int quic_build_post_handshake_frames(struct quic_conn *qc)
+int quic_build_post_handshake_frames(struct quic_conn *qc,
+ struct list *to_frm_list)
{
int ret = 0, max = 0;
- struct quic_enc_level *qel;
struct quic_frame *frm, *frmbak;
struct list frm_list = LIST_HEAD_INIT(frm_list);
struct eb64_node *node;
TRACE_ENTER(QUIC_EV_CONN_IO_CB, qc);
- qel = qc->ael;
/* Only servers must send a HANDSHAKE_DONE frame. */
if (objt_listener(qc->target)) {
size_t new_token_frm_len;
LIST_APPEND(&frm_list, &frm->list);
}
- LIST_SPLICE(&qel->pktns->tx.frms, &frm_list);
+ LIST_SPLICE(to_frm_list, &frm_list);
qc->flags &= ~QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS;
ret = 1;
*/
if ((qc->flags & QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS) && qc->conn &&
qc->state >= QUIC_HS_ST_COMPLETE) {
- quic_build_post_handshake_frames(qc);
+ quic_build_post_handshake_frames(qc, &qc->ael->pktns->tx.frms);
}
/* Retranmissions */
/* Try to send post handshake frames first unless on 0-RTT. */
if ((qc->flags & QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS) &&
qc->state >= QUIC_HS_ST_COMPLETE) {
- quic_build_post_handshake_frames(qc);
+ quic_build_post_handshake_frames(qc, &qc->ael->pktns->tx.frms);
qel_register_send(&send_list, qc->ael, &qc->ael->pktns->tx.frms);
qc_send(qc, 0, &send_list, 0);
}