]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
DoH: reduce excessive bad request logging
authorArtem Boldariev <artem@isc.org>
Thu, 18 Jul 2024 17:21:53 +0000 (20:21 +0300)
committerAndoni Duarte <andoni@isc.org>
Wed, 15 Jan 2025 14:09:17 +0000 (14:09 +0000)
We started using isc_nm_bad_request() more actively throughout
codebase. In the case of HTTP/2 it can lead to a large count of
useless "Bad Request" messages in the BIND log, as often we attempt to
send such request over effectively finished HTTP/2 sessions.

This commit fixes that.

lib/isc/netmgr/http.c

index 6e2a3bbe4683dd2cd7c80590c162d8bde803ff08..228703592161f95eee30d3b03234a379c5f8bc40 100644 (file)
@@ -2484,6 +2484,12 @@ isc__nm_http_bad_request(isc_nmhandle_t *handle) {
        REQUIRE(!sock->client);
        REQUIRE(VALID_HTTP2_SESSION(sock->h2->session));
 
+       if (sock->h2->response_submitted ||
+           !http_session_active(sock->h2->session))
+       {
+               return;
+       }
+
        (void)server_send_error_response(ISC_HTTP_ERROR_BAD_REQUEST,
                                         sock->h2->session->ngsession, sock);
 }