]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Reply to HTTP/2 PING frames immediately 14128/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 3 May 2024 12:28:12 +0000 (14:28 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 3 May 2024 12:28:12 +0000 (14:28 +0200)
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.

pdns/dnsdistdist/dnsdist-nghttp2-in.cc

index f88294168e72d8c58c686793df9d8a0be4360682..3898996b28cde82b92eb53920e6a6a4c6f6b635d 100644 (file)
@@ -918,6 +918,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;
 }