Commit f5c7d24f authored by Walid Boudebouda's avatar Walid Boudebouda Committed by Dridi Boukelmoune

vtc: New stream.peer_window variable for h2 checks

Closes #3681
Signed-off-by: 's avatarDridi Boukelmoune <dridi.boukelmoune@gmail.com>
parent 75c344d2
......@@ -8,8 +8,20 @@ server s1 {
txcont -hdr "baz" "qux"
txdata -data "foo"
txdata -data "bar"
expect stream.peer_window == 65529
rxreq
txresp -bodylen 529
expect stream.peer_window == 65000
rxwinup
expect stream.peer_window == 65200
} -run
stream 0 {
expect stream.peer_window == 65000
rxwinup
expect stream.peer_window == 66000
} -run
} -start
client c1 -connect ${s1_sock} {
......@@ -35,6 +47,15 @@ client c1 -connect ${s1_sock} {
stream 0 {
expect stream.window == 65529
} -run
stream 2 {
txreq
rxresp
txwinup -size 200
} -run
stream 0 {
txwinup -size 1000
} -run
} -run
server s1 -wait
......@@ -2,17 +2,23 @@ varnishtest "Verify the initial window size"
server s1 {
stream 0 {
expect stream.peer_window == 65535
rxsettings
txsettings -ack
} -run
stream 1 {
expect stream.peer_window == 128
rxreq
txresp -bodylen 100
expect stream.peer_window == 28
} -run
stream 0 {
rxsettings
txsettings -ack
} -run
stream 1 {
expect stream.peer_window == -36
} -run
} -start
client c1 -connect ${s1_sock} {
......
......@@ -1124,7 +1124,11 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf)
/* SECTION: stream.spec.zexpect.zstream Stream
*
* stream.window
* The current window size of the stream, or, if on stream 0,
* The current local window size of the stream, or, if on stream 0,
* of the connection.
*
* stream.peer_window
* The current peer window size of the stream, or, if on stream 0,
* of the connection.
*
* stream.weight
......@@ -1138,6 +1142,11 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf)
(intmax_t)(s->id ? s->win_self : s->hp->h2_win_self->size));
return (buf);
}
if (!strcmp(spec, "stream.peer_window")) {
snprintf(buf, 20, "%jd",
(intmax_t)(s->id ? s->win_peer : s->hp->h2_win_peer->size));
return (buf);
}
if (!strcmp(spec, "stream.weight")) {
if (s->id) {
snprintf(buf, 20, "%d", s->weight);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment