]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Handle Quiche >= 0.23.0 since the API changed 15118/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 4 Feb 2025 15:24:08 +0000 (16:24 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 4 Feb 2025 15:24:08 +0000 (16:24 +0100)
Quiche 0.23.0 has renamed `quiche_h3_event_headers_has_body` to
`quiche_h3_event_headers_has_more_frames`, so we need to handle that.

pdns/dnsdistdist/doh3.cc
pdns/dnsdistdist/m4/pdns_with_quiche.m4
pdns/dnsdistdist/meson/quiche/meson.build

index c67f053db9b3a19d95d0100a71f8ef7ce2bba8e1..e4da7986a5bd4a6ad3fe0f9d3e89c887a9612b3e 100644 (file)
@@ -771,7 +771,11 @@ static void processH3HeaderEvent(ClientState& clientState, DOH3Frontend& fronten
   }
 
   if (headers.at(":method") == "POST") {
+#if defined(HAVE_QUICHE_H3_EVENT_HEADERS_HAS_MORE_FRAMES)
+    if (!quiche_h3_event_headers_has_more_frames(event)) {
+#else
     if (!quiche_h3_event_headers_has_body(event)) {
+#endif
       handleImmediateError("Empty POST query");
     }
     return;
index 784c9cb869eec34d0855bf529dc01587e88a8cea..e663185f7c78c3e79c147392157fc9b28d8d5da6 100644 (file)
@@ -10,16 +10,23 @@ AC_DEFUN([PDNS_WITH_QUICHE], [
 
   AS_IF([test "x$with_quiche" != "xno"], [
     AS_IF([test "x$with_quiche" = "xyes" -o "x$with_quiche" = "xauto"], [
-      PKG_CHECK_MODULES([QUICHE], [quiche >= 0.22.0], [
+      PKG_CHECK_MODULES([QUICHE], [quiche >= 0.23.0], [
         [HAVE_QUICHE=1]
         AC_DEFINE([HAVE_QUICHE], [1], [Define to 1 if you have quiche])
+        AC_DEFINE([HAVE_QUICHE_H3_EVENT_HEADERS_HAS_MORE_FRAMES], [1], [Define to 1 if the Quiche API has quiche_h3_event_headers_has_more_frames instead of quiche_h3_event_headers_has_body])
         AC_DEFINE([HAVE_QUICHE_STREAM_ERROR_CODES], [1], [Define to 1 if the Quiche API includes error code in quiche_conn_stream_recv and quiche_conn_stream_send])
       ], [
-        # Quiche is older than 0.22.0, or no Quiche at all
-        PKG_CHECK_MODULES([QUICHE], [quiche >= 0.15.0], [
+        PKG_CHECK_MODULES([QUICHE], [quiche >= 0.22.0], [
           [HAVE_QUICHE=1]
           AC_DEFINE([HAVE_QUICHE], [1], [Define to 1 if you have quiche])
-        ], [ : ])
+          AC_DEFINE([HAVE_QUICHE_STREAM_ERROR_CODES], [1], [Define to 1 if the Quiche API includes error code in quiche_conn_stream_recv and quiche_conn_stream_send])
+        ], [
+          # Quiche is older than 0.22.0, or no Quiche at all
+          PKG_CHECK_MODULES([QUICHE], [quiche >= 0.15.0], [
+            [HAVE_QUICHE=1]
+            AC_DEFINE([HAVE_QUICHE], [1], [Define to 1 if you have quiche])
+          ], [ : ])
+        ])
       ])
       AS_IF([test "x$HAVE_QUICHE" = "x1"], [
         save_CFLAGS=$CFLAGS
index 0774c1a58dd8f7a4f61f3a5a76a4038ad0ac05d3..d03aade91f6e48966ee24466216e26dc7b2ef4f5 100644 (file)
@@ -2,7 +2,12 @@ dep_libquiche = dependency('', required: false)
 opt_libquiche = get_option('quiche')
 
 if (get_option('dns-over-quic') or get_option('dns-over-http3')) and opt_libquiche.allowed()
-  dep_libquiche = dependency('quiche', version: '>= 0.22.0', required: opt_libquiche)
+  dep_libquiche = dependency('quiche', version: '>= 0.23.0', required: opt_libquiche)
+  if dep_libquiche.found()
+    conf.set('HAVE_QUICHE_H3_EVENT_HEADERS_HAS_MORE_FRAMES', dep_libquiche.found(), description: 'if the Quiche API has quiche_h3_event_headers_has_more_frames instead of quiche_h3_event_headers_has_body')
+  else
+    dep_libquiche = dependency('quiche', version: '>= 0.22.0', required: opt_libquiche)
+  endif
 
   if dep_libquiche.found()
     conf.set('HAVE_QUICHE_STREAM_ERROR_CODES', dep_libquiche.found(), description: 'if the Quiche API includes error code in quiche_conn_stream_recv and quiche_conn_stream_send')