]> git.kaiwu.me - haproxy.git/commitdiff
REGTESTS: connection: do not race with the reset in the expect-proxy test
authorWilly Tarreau <w@1wt.eu>
Tue, 22 Sep 2026 04:14:57 +0000 (04:14 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 15:19:30 +0000 (17:19 +0200)
The client which sends a malformed PROXY header also sent a request
behind it. The connection is reset as soon as the header line is
complete, so on a build where the reset comes back fast enough the
write of the request fails with ECONNRESET instead of succeeding, and
the test fails. Nothing needs to be sent after the bad header.

reg-tests/connection/expect_proxy.vtc

index 481eb6e2a7062ef9544b93b08002ce5c9f923107..cde558c8f2549f16b0a40d93f8fd103fe82e2c3f 100644 (file)
@@ -63,9 +63,9 @@ client c2 -connect ${h1_fe1_sock} {
 } -run
 
 client c3 -connect ${h1_fe1_sock} {
-       # a malformed header is rejected as well
+       # a malformed header is rejected as soon as its line is complete, so
+       # nothing else is sent here: the request would race with the reset
        send "PROXY TCP4 not an address at all\r\n"
-       txreq
        expect_close
 } -run