]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix detection of a specific nghttp2 feature
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 25 Sep 2024 18:41:39 +0000 (20:41 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 28 Jan 2025 13:37:19 +0000 (14:37 +0100)
The `#if` should be `#ifdef` or `#if defined`, as otherwise it fails
with the `config.h` generated by `meson`.

pdns/dnsdistdist/dnsdist-nghttp2-in.cc

index 9907938dae43651e2966c37a7323b61c6980e417..c93a8a3c953d29a7f7b43556b56d1d819a6c8066 100644 (file)
@@ -981,7 +981,7 @@ int IncomingHTTP2Connection::on_header_callback(nghttp2_session* session, const
       return NGHTTP2_ERR_CALLBACK_FAILURE;
     }
 
-#ifdef HAVE_NGHTTP2_CHECK_HEADER_VALUE_RFC9113
+#if defined(HAVE_NGHTTP2_CHECK_HEADER_VALUE_RFC9113)
     if (nghttp2_check_header_value_rfc9113(value, valuelen) == 0) {
       vinfolog("Invalid header value");
       return NGHTTP2_ERR_CALLBACK_FAILURE;
@@ -1001,7 +1001,7 @@ int IncomingHTTP2Connection::on_header_callback(nghttp2_session* session, const
     // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast): nghttp2 API
     auto valueView = std::string_view(reinterpret_cast<const char*>(value), valuelen);
     if (headerMatches(s_pathHeaderName)) {
-#ifdef HAVE_NGHTTP2_CHECK_PATH
+#if defined(HAVE_NGHTTP2_CHECK_PATH)
       if (nghttp2_check_path(value, valuelen) == 0) {
         vinfolog("Invalid path value");
         return NGHTTP2_ERR_CALLBACK_FAILURE;
@@ -1021,7 +1021,7 @@ int IncomingHTTP2Connection::on_header_callback(nghttp2_session* session, const
       query.d_scheme = valueView;
     }
     else if (headerMatches(s_methodHeaderName)) {
-#if HAVE_NGHTTP2_CHECK_METHOD
+#if defined(HAVE_NGHTTP2_CHECK_METHOD)
       if (nghttp2_check_method(value, valuelen) == 0) {
         vinfolog("Invalid method value");
         return NGHTTP2_ERR_CALLBACK_FAILURE;