Mailing List Archive

[6.0] 2719cba1c http2_proto: Send GOAWAY before leaving the rx loop
commit 2719cba1cb222d2006600b85e9c25c85be1c4507
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Thu Nov 16 17:30:17 2023 +0100

http2_proto: Send GOAWAY before leaving the rx loop

Conflicts:
bin/varnishtest/tests/t02005.vtc

diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 36ccb895e..4dae3e19b 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -404,7 +404,7 @@ h2_tx_goaway(struct worker *wrk, struct h2_sess *h2, h2_error h2e)
ASSERT_RXTHR(h2);
AN(h2e);

- if (h2->goaway)
+ if (h2->goaway || !h2e->send_goaway)
return;

h2->goaway = 1;
@@ -1469,6 +1469,7 @@ h2_rxframe(struct worker *wrk, struct h2_sess *h2)

if (h2e != NULL && h2e->connection) {
h2->error = h2e;
+ h2_tx_goaway(wrk, h2, h2e);
return (0);
}

diff --git a/bin/varnishtest/tests/t02003.vtc b/bin/varnishtest/tests/t02003.vtc
index 1d62ac986..fe30e8243 100644
--- a/bin/varnishtest/tests/t02003.vtc
+++ b/bin/varnishtest/tests/t02003.vtc
@@ -233,17 +233,28 @@ client c1 {
} -run

client c1 {
+ stream 0 {
+ rxgoaway
+ expect goaway.err == NO_ERROR
+ expect goaway.laststream == 3
+ } -start
stream 1 {
- txreq -nohdrend
+ txreq -nostrend
txrst -err 2
} -run
stream 3 {
- txreq -nohdrend
+ txreq -nostrend
txrst -err 0x666
} -run
+ stream 0 -wait
} -run

client c1 {
+ stream 0 {
+ rxgoaway
+ expect goaway.err == NO_ERROR
+ expect goaway.laststream == 1
+ } -start
stream 1 {
txreq
rxresp
@@ -252,6 +263,7 @@ client c1 {
# RST_STREAM on closed stream
txrst
} -run
+ stream 0 -wait
} -run


diff --git a/bin/varnishtest/tests/t02005.vtc b/bin/varnishtest/tests/t02005.vtc
index 03c9a85ae..9aff481c9 100644
--- a/bin/varnishtest/tests/t02005.vtc
+++ b/bin/varnishtest/tests/t02005.vtc
@@ -27,7 +27,7 @@ varnish v1 -cliok "param.set debug +syncvsl"

logexpect l1 -v v1 -g raw {
expect * 1001 ReqAcct "80 7 87 106 8 114"
- expect * 1000 ReqAcct "45 8 53 54 20 74"
+ expect * 1000 ReqAcct "45 8 53 63 28 91"
} -start

client c1 {
diff --git a/bin/varnishtest/tests/t02025.vtc b/bin/varnishtest/tests/t02025.vtc
index 4b83fe95b..39f987a06 100644
--- a/bin/varnishtest/tests/t02025.vtc
+++ b/bin/varnishtest/tests/t02025.vtc
@@ -25,12 +25,17 @@ logexpect l1 -v v1 -g raw -i Debug {
} -start

client c1 {
+ stream 0 {
+ rxgoaway
+ expect goaway.err == NO_ERROR
+ expect goaway.laststream == 1
+ } -start
stream 1 {
txreq
barrier b1 sync
txrst
} -run
- expect_close
+ stream 0 -wait
} -start

logexpect l1 -wait
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit