From: Remi Gacogne Date: Wed, 25 Sep 2024 18:41:39 +0000 (+0200) Subject: dnsdist: Fix detection of a specific nghttp2 feature X-Git-Tag: dnsdist-2.0.0-alpha1~128^2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e8e6f4619f49b84b44de9795d7146506bf9caa89;p=thirdparty%2Fpdns.git dnsdist: Fix detection of a specific nghttp2 feature The `#if` should be `#ifdef` or `#if defined`, as otherwise it fails with the `config.h` generated by `meson`. --- diff --git a/pdns/dnsdistdist/dnsdist-nghttp2-in.cc b/pdns/dnsdistdist/dnsdist-nghttp2-in.cc index 9907938dae..c93a8a3c95 100644 --- a/pdns/dnsdistdist/dnsdist-nghttp2-in.cc +++ b/pdns/dnsdistdist/dnsdist-nghttp2-in.cc @@ -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(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;