]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Handle Quiche >= 0.23.0 since the API changed 15183/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 4 Feb 2025 15:24:08 +0000 (16:24 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 20 Feb 2025 10:37:30 +0000 (11:37 +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.

(cherry picked from commit 35ab1dbe0ab9814445e8be8ba3ab7b719e1b5667)

pdns/dnsdistdist/doh3.cc
pdns/dnsdistdist/m4/pdns_with_quiche.m4

index 4f1a32e071907ca76bae50e286ab3678096f11a3..236c19369b67dca84aab67c4c0a1fb4c1312110b 100644 (file)
@@ -751,7 +751,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 672fe0f79f225c0e4ec30648bf464ed05906e581..31f8682e5c1ce28cbdffbfae38f60cc49ffa8a37 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])
+          ], [ : ])
+        ])
       ])
     ])
   ])