Skip to content

Commit

Permalink
Handle RST_STREAM on completed streams
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdphk committed Mar 23, 2017
1 parent 6358f4a commit cc5c71b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/varnishd/http2/cache_http2_proto.c
Expand Up @@ -273,9 +273,10 @@ h2_rx_rst_stream(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
{
(void)wrk;

AN(r2);
if (h2->rxf_len != 4) // rfc7540,l,2003,2004
return (H2CE_FRAME_SIZE_ERROR);
if (r2 == NULL)
return (0);
Lck_Lock(&h2->sess->mtx);
r2->error = h2_streamerror(vbe32dec(h2->rxf_data));
VSLb(h2->vsl, SLT_Debug, "H2RST %u %d %s", r2->stream, r2->state, r2->error->name);
Expand Down
2 changes: 2 additions & 0 deletions bin/varnishtest/tests/t02000.vtc
Expand Up @@ -36,6 +36,8 @@ client c1 {
txreq -dep 3 -hdr :authority foo.bar -pad cotton
rxresp
expect resp.status == 200
delay 1
txrst -err 0x1111
} -start
stream 0 {
txping -data "_-__-_-_"
Expand Down

0 comments on commit cc5c71b

Please sign in to comment.