Skip to content

Instantly share code, notes, and snippets.

@rezan
Created February 13, 2019 00:52
Show Gist options
  • Select an option

  • Save rezan/015b181d0fa14392f14f9cf05060d6c3 to your computer and use it in GitHub Desktop.

Select an option

Save rezan/015b181d0fa14392f14f9cf05060d6c3 to your computer and use it in GitHub Desktop.
When you gunzip a streaming response, you can race on OA_GZIPBITS
varnishtest "VDP gunzip OA_GZIPBITS streaming race"
# Note this should run with -j64 -n10000
server s1 -repeat 50 {
rxreq
txresp -gziplen 3167
} -start
varnish v1 -vcl+backend {
sub vcl_recv {
return (pass);
}
} -start
client c1 -repeat 50 {
txreq
rxresp
# 503 is an unrelated system error
expect resp.status == 200
# 3167 with a missing 8 bit write is either 3072 or 95
# No Content-Length (chunked) is valid for this race
expect resp.http.Content-Length != "3072"
expect resp.http.Content-Length != "95"
expect resp.bodylen == 3167
} -run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment