From 8487281b528e5bb206d0da65cb66fada25ec85cc Mon Sep 17 00:00:00 2001 From: David Zhuang Date: Tue, 5 Aug 2025 18:27:23 -0700 Subject: [PATCH] declare first --- lib/vquic/curl_ngtcp2.c | 8 ++++---- lib/vquic/curl_osslq.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 49f3aeb529..fdea88c22c 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -1199,6 +1199,8 @@ static CURLcode init_ngh3_conn(struct Curl_cfilter *cf, struct Curl_easy *data) { struct cf_ngtcp2_ctx *ctx = cf->ctx; + nghttp3_mem mem = {NULL, Curl_ngtcp2_malloc, Curl_ngtcp2_free, + Curl_ngtcp2_calloc, Curl_ngtcp2_realloc}; int64_t ctrl_stream_id, qpack_enc_stream_id, qpack_dec_stream_id; int rc; @@ -1208,8 +1210,6 @@ static CURLcode init_ngh3_conn(struct Curl_cfilter *cf, } nghttp3_settings_default(&ctx->h3settings); - nghttp3_mem mem = {NULL, Curl_ngtcp2_malloc, Curl_ngtcp2_free, - Curl_ngtcp2_calloc, Curl_ngtcp2_realloc}; rc = nghttp3_conn_client_new(&ctx->h3conn, &ngh3_callbacks, @@ -2425,6 +2425,8 @@ static CURLcode cf_connect_start(struct Curl_cfilter *cf, struct pkt_io_ctx *pktx) { struct cf_ngtcp2_ctx *ctx = cf->ctx; + ngtcp2_mem mem = {NULL, Curl_ngtcp2_malloc, Curl_ngtcp2_free, + Curl_ngtcp2_calloc, Curl_ngtcp2_realloc}; int rc; int rv; CURLcode result; @@ -2467,8 +2469,6 @@ static const struct alpn_spec ALPN_SPEC_H3 = { ctx->q.local_addrlen); ngtcp2_addr_init(&ctx->connected_path.remote, &sockaddr->curl_sa_addr, (socklen_t)sockaddr->addrlen); - ngtcp2_mem mem = {NULL, Curl_ngtcp2_malloc, Curl_ngtcp2_free, - Curl_ngtcp2_calloc, Curl_ngtcp2_realloc}; rc = ngtcp2_conn_client_new(&ctx->qconn, &ctx->dcid, &ctx->scid, &ctx->connected_path, diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 4e4fa7fc6d..6d9803ea3a 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -1099,12 +1099,12 @@ static CURLcode cf_osslq_h3conn_init(struct cf_osslq_ctx *ctx, SSL *conn, void *user_data) { struct cf_osslq_h3conn *h3 = &ctx->h3; + nghttp3_mem mem = {NULL, Curl_ngtcp2_malloc, Curl_ngtcp2_free, + Curl_ngtcp2_calloc, Curl_ngtcp2_realloc}; CURLcode result; int rc; nghttp3_settings_default(&h3->settings); - nghttp3_mem mem = {NULL, Curl_ngtcp2_malloc, Curl_ngtcp2_free, - Curl_ngtcp2_calloc, Curl_ngtcp2_realloc}; rc = nghttp3_conn_client_new(&h3->conn, &ngh3_callbacks, &h3->settings,