From 3a22845932e0fbc5a5f4434e33797d0cb9f3eb75 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 3 May 2024 14:28:12 +0200 Subject: [PATCH] dnsdist: Reply to HTTP/2 PING frames immediately We usually buffer a bit to avoid sending a lot of small data chunks on the wire (or to the kernel anyway), but for `HTTP/2 PING` frames that are not followed by anything else calling for a response, this causes an issue as these frames are designed to measure the latency between a client and a server, and are used by HTTP/2 proxies to ensure that a connection can be reused. (cherry picked from commit 4170083b33b171b150257311ef832c743f4d32c6) --- pdns/dnsdistdist/dnsdist-nghttp2-in.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pdns/dnsdistdist/dnsdist-nghttp2-in.cc b/pdns/dnsdistdist/dnsdist-nghttp2-in.cc index e40f5e64b1..a016363c6f 100644 --- a/pdns/dnsdistdist/dnsdist-nghttp2-in.cc +++ b/pdns/dnsdistdist/dnsdist-nghttp2-in.cc @@ -922,6 +922,9 @@ int IncomingHTTP2Connection::on_frame_recv_callback(nghttp2_session* session, co return NGHTTP2_ERR_CALLBACK_FAILURE; } } + else if (frame->hd.type == NGHTTP2_PING) { + conn->d_needFlush = true; + } return 0; } -- 2.47.2