By default when building an H2 request, vtest sets the END_STREAM flag
on the HEADERS frame. This is problematic with the websocket and proto
upgrade tests since we're using CONNECT, because it immediately closes
afterwards, which does not correspond to what we're testing. Doing this
in abortonclose mode rightfully produces an error. Let's fix the test
so as not to set the flag on the HEADERS frame. However, doing so means
we'll receive a window update that we must also accept. Now the test
works both with and without abortonclose.
-scheme "http" \
-url "/" \
-hdr ":authority" "127.0.0.1" \
- -hdr ":protocol" "custom_protocol"
+ -hdr ":protocol" "custom_protocol" \
+ -nostrend
+ rxwinup
rxhdrs
expect resp.status == 200
} -run
-scheme "http" \
-url "/" \
-hdr ":authority" "127.0.0.1" \
- -hdr ":protocol" "custom_protocol"
+ -hdr ":protocol" "custom_protocol" \
+ -nostrend
+ rxwinup
rxhdrs
expect resp.status == 200
} -run
-scheme "http" \
-url "/" \
-hdr ":authority" "127.0.0.1" \
- -hdr ":protocol" "h2c"
+ -hdr ":protocol" "h2c" \
+ -nostrend
rxrst
expect rst.err == 1
-scheme "http" \
-url "/" \
-hdr ":authority" "127.0.0.1" \
- -hdr ":protocol" "websocket"
+ -hdr ":protocol" "websocket" \
+ -nostrend
+ rxwinup
rxhdrs
expect resp.status == 200
} -run
-scheme "http" \
-url "/" \
-hdr ":authority" "127.0.0.1" \
- -hdr ":protocol" "websocket"
+ -hdr ":protocol" "websocket" \
+ -nostrend
+ rxwinup
rxhdrs
expect resp.status == 502
} -run