Skip to content

Commit

Permalink
http2_proto: Send GOAWAY before leaving the rx loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Dridi authored and simonvik committed Mar 18, 2024
1 parent 05d91fa commit 9aa45a9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
3 changes: 2 additions & 1 deletion bin/varnishd/http2/cache_http2_proto.c
Expand Up @@ -412,7 +412,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;
Expand Down Expand Up @@ -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);
}

Expand Down
16 changes: 14 additions & 2 deletions bin/varnishtest/tests/t02003.vtc
Expand Up @@ -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
Expand All @@ -252,6 +263,7 @@ client c1 {
# RST_STREAM on closed stream
txrst
} -run
stream 0 -wait
} -run


Expand Down
2 changes: 1 addition & 1 deletion bin/varnishtest/tests/t02005.vtc
Expand Up @@ -32,7 +32,7 @@ varnish v1 -cliok "param.set debug +syncvsl"

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

client c1 {
Expand Down
7 changes: 6 additions & 1 deletion bin/varnishtest/tests/t02025.vtc
Expand Up @@ -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
Expand Down

0 comments on commit 9aa45a9

Please sign in to comment.