]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vquic: initialize new callback in nghttp3 1.14.0+
authorViktor Szakats <commit@vsz.me>
Tue, 23 Dec 2025 11:24:30 +0000 (12:24 +0100)
committerViktor Szakats <commit@vsz.me>
Tue, 23 Dec 2025 12:34:07 +0000 (13:34 +0100)
Fixing (seen in curl-for-win production build):
```
lib/vquic/curl_ngtcp2.c:1257:1: error: missing field 'recv_settings2' initializer [-Werror,-Wmissing-field-initializers]
 1257 | };
      | ^
1 error generated.
```
Ref: https://ci.appveyor.com/project/curlorg/curl-for-win/builds/53281785#L6752
Ref: https://github.com/curl/curl/actions/runs/20459295003/job/58788229134#step:3:5513

Also:
- Mark previous callback deprecated.
- Document ngtcp2, nghttp3 versions for callback entry feature guards.

Refs:
https://github.com/ngtcp2/nghttp3/releases/tag/v1.14.0
https://github.com/ngtcp2/nghttp3/pull/432
https://github.com/ngtcp2/nghttp3/commit/1616ab835061d7cdd2ef114bc3ddb917ce269611

Closes #20077

lib/vquic/curl_ngtcp2.c
lib/vquic/curl_osslq.c

index 20b9240f09ed4fb08c9142856cfb7683f7d094b3..7a0c214422bf0e69e6adae597b3ba896d57e37aa 100644 (file)
@@ -877,7 +877,7 @@ static ngtcp2_callbacks ng_callbacks = {
   cb_recv_rx_key,
   NULL, /* recv_tx_key */
   NULL, /* early_data_rejected */
-#ifdef NGTCP2_CALLBACKS_V2
+#ifdef NGTCP2_CALLBACKS_V2  /* ngtcp2 v1.14.0+ */
   NULL, /* begin_path_validation */
 #endif
 };
@@ -1291,12 +1291,15 @@ static nghttp3_callbacks ngh3_callbacks = {
   NULL, /* end_stream */
   cb_h3_reset_stream,
   NULL, /* shutdown */
-  NULL, /* recv_settings */
-#ifdef NGHTTP3_CALLBACKS_V2
+  NULL, /* recv_settings (deprecated) */
+#ifdef NGHTTP3_CALLBACKS_V2  /* nghttp3 v1.11.0+ */
   NULL, /* recv_origin */
   NULL, /* end_origin */
   NULL, /* rand */
 #endif
+#ifdef NGHTTP3_CALLBACKS_V3  /* nghttp3 v1.14.0+ */
+  NULL, /* recv_settings2 */
+#endif
 };
 
 static CURLcode init_ngh3_conn(struct Curl_cfilter *cf,
index cffe61a4022d35c4d0360cc54526ae95e9b0b9a4..537484faf66a3c8e10c8a95d0e2d3955c1e7d6f0 100644 (file)
@@ -1074,12 +1074,15 @@ static nghttp3_callbacks ngh3_callbacks = {
   NULL, /* end_stream */
   cb_h3_reset_stream,
   NULL, /* shutdown */
-  NULL, /* recv_settings */
-#ifdef NGHTTP3_CALLBACKS_V2
+  NULL, /* recv_settings (deprecated) */
+#ifdef NGHTTP3_CALLBACKS_V2  /* nghttp3 v1.11.0+ */
   NULL, /* recv_origin */
   NULL, /* end_origin */
   NULL, /* rand */
 #endif
+#ifdef NGHTTP3_CALLBACKS_V3  /* nghttp3 v1.14.0+ */
+  NULL, /* recv_settings2 */
+#endif
 };
 
 static CURLcode cf_osslq_h3conn_init(struct cf_osslq_ctx *ctx, SSL *conn,