Commit 03f71c6e authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

h2: Reset the stream upon delivery error

Until now we'd send a zero-length DATA frame with the END_STREAM flag
set, masquerading fetch streaming failures as completed responses. In
the absence of a content-length header a user agent couldn't notice
there was a problem.

This does not apply to ESI sub-requests, they aren't streamed during
delivery.
parent 0145e4a7
......@@ -95,6 +95,14 @@ h2_fini(struct vdp_ctx *vdc, void **priv)
if (r2->error)
return (0);
if (vdc->retval) {
r2->error = H2SE_INTERNAL_ERROR; /* XXX: proper error? */
H2_Send_Get(vdc->wrk, r2->h2sess, r2);
H2_Send_RST(vdc->wrk, r2->h2sess, r2, r2->stream, r2->error);
H2_Send_Rel(r2->h2sess, r2);
return (0);
}
H2_Send_Get(vdc->wrk, r2->h2sess, r2);
H2_Send(vdc->wrk, r2, H2_F_DATA, H2FF_DATA_END_STREAM, 0, "", NULL);
H2_Send_Rel(r2->h2sess, r2);
......
......@@ -23,29 +23,23 @@ client c1 {
expect_close
} -run
delay .3
varnish v1 -expect MAIN.sc_range_short == 1
server s1 {
rxreq
txresp -nolen -hdr "Content-length: 9"
delay 1
send "BLA"
delay .4
send "BLA"
delay .3
send "BL"
} -start
delay .3
varnish v1 -cliok "param.set feature +http2"
client c1 {
server s1 -start
client c2 {
stream 1 {
txreq -hdr "range" "bytes=0-16"
rxhdrs
expect resp.status == 206
expect resp.http.content-length == 9
rxdata -all
rxdata -some 3
expect resp.body == BLABLABL
rxrst
expect rst.err == INTERNAL_ERROR
} -run
} -run
varnish v1 -expect MAIN.sc_range_short == 1
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