From cbf7972f10a5ef96e544df446144bb1a05bcc7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 31 May 2017 13:20:12 +0200 Subject: Don't terminate streams that were already terminated This and the issues in the last two commits were reported by leo2007 on IRC. --- src/cowboy_http2.erl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/cowboy_http2.erl b/src/cowboy_http2.erl index ae5f5b9..6967bb0 100644 --- a/src/cowboy_http2.erl +++ b/src/cowboy_http2.erl @@ -689,6 +689,9 @@ terminate_reason({internal_error, _, _}) -> internal_error. terminate_all_streams([], _, []) -> ok; +%% This stream was already terminated and is now just flushing the data out. Skip it. +terminate_all_streams([#stream{state=flush}|Tail], Reason, Children) -> + terminate_all_streams(Tail, Reason, Children); terminate_all_streams([#stream{id=StreamID, state=StreamState}|Tail], Reason, Children0) -> stream_call_terminate(StreamID, Reason, StreamState), Children = stream_terminate_children(Children0, StreamID, []), -- cgit v1.2.3