[PATCH 3 of 5] Tests: improved h2_priority.t

Maxim Dounin mdounin at mdounin.ru
Sat Jul 19 03:15:07 UTC 2025


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1752891914 -10800
#      Sat Jul 19 05:25:14 2025 +0300
# Node ID 0f089661084dfb37a525fb33221dab288985be6e
# Parent  a93d11a64ed526a847d531dae657d23b41550395
Tests: improved h2_priority.t.

Tests in h2_priority.t do not tolerate extra data being split over multiple
HTTP/2 frames, yet this can happen if writing to the socket buffer blocks
and then a small amount of data (1 byte) remains in the HTTP/2 connection
queue due to flow control: when the window is opened again, this 1 byte
will be sent in a separate frame, and the remaining bytes will be read and
sent afterwards.

Failures due to this issue were observed during testing on OpenBSD, and
might be easily reproduced on other platforms with small enough socket
buffers.

Fix is to use output_buffers large enough to read the full response, so the
remaining bytes are always sent in a single HTTP/2 frame.

diff --git a/h2_priority.t b/h2_priority.t
--- a/h2_priority.t
+++ b/h2_priority.t
@@ -40,6 +40,7 @@ http {
         listen       127.0.0.1:8080;
         server_name  localhost;
         http2 on;
+        output_buffers 3 32k;
     }
 }
 



More information about the nginx-devel mailing list