MINOR: quic: uneeded xprt context variable passed as parameter

This quic_conn ->xrpt_ctx is passed to qc_send_ppkts(), the quic_conn is retrieved
from this context to be used inside this function and it is not used at all
by this function.

This patch simply directly passes the quic_conn to qc_send_ppkts(). This is only
what this function needs.
This commit is contained in:
Frederic Lecaille 2025-11-20 08:17:44 +01:00
parent a88fdf8669
commit 2c6720a163

View File

@ -284,13 +284,11 @@ static void qc_purge_tx_buf(struct quic_conn *qc, struct buffer *buf)
* Remaining data are purged from the buffer and will eventually be detected * Remaining data are purged from the buffer and will eventually be detected
* as lost which gives the opportunity to retry sending. * as lost which gives the opportunity to retry sending.
*/ */
static int qc_send_ppkts(struct buffer *buf, struct ssl_sock_ctx *ctx) static int qc_send_ppkts(struct buffer *buf, struct quic_conn *qc)
{ {
int ret = 0; int ret = 0;
struct quic_conn *qc;
char skip_sendto = 0; char skip_sendto = 0;
qc = ctx->qc;
TRACE_ENTER(QUIC_EV_CONN_SPPKTS, qc); TRACE_ENTER(QUIC_EV_CONN_SPPKTS, qc);
while (b_contig_data(buf, 0)) { while (b_contig_data(buf, 0)) {
unsigned char *pos; unsigned char *pos;
@ -494,7 +492,7 @@ int qc_purge_txbuf(struct quic_conn *qc, struct buffer *buf)
*/ */
BUG_ON(!qc_test_fd(qc)); BUG_ON(!qc_test_fd(qc));
if (b_data(buf) && !qc_send_ppkts(buf, qc->xprt_ctx)) { if (b_data(buf) && !qc_send_ppkts(buf, qc)) {
if (qc->flags & QUIC_FL_CONN_TO_KILL) if (qc->flags & QUIC_FL_CONN_TO_KILL)
qc_txb_release(qc); qc_txb_release(qc);
TRACE_DEVEL("leaving in error", QUIC_EV_CONN_TXPKT, qc); TRACE_DEVEL("leaving in error", QUIC_EV_CONN_TXPKT, qc);
@ -933,7 +931,7 @@ int qc_send(struct quic_conn *qc, int old_data, struct list *send_list,
prep = qc_prep_pkts(qc, buf, send_list, max_dgrams ? max_dgrams - ret : 0); prep = qc_prep_pkts(qc, buf, send_list, max_dgrams ? max_dgrams - ret : 0);
BUG_ON(max_dgrams && prep > max_dgrams); BUG_ON(max_dgrams && prep > max_dgrams);
if (b_data(buf) && !qc_send_ppkts(buf, qc->xprt_ctx)) { if (b_data(buf) && !qc_send_ppkts(buf, qc)) {
if (qc->flags & QUIC_FL_CONN_TO_KILL) if (qc->flags & QUIC_FL_CONN_TO_KILL)
qc_txb_release(qc); qc_txb_release(qc);
ret = -1; ret = -1;