aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-05-31 13:20:12 +0200
committerLoïc Hoguin <[email protected]>2017-05-31 13:20:12 +0200
commitcbf7972f10a5ef96e544df446144bb1a05bcc7cf (patch)
tree75a0588eaa7fe4ad7da00612d0d53037f0e6b05c /src
parentcad3e3f63d96559f16ee90e661a29063d0b3fc80 (diff)
downloadcowboy-cbf7972f10a5ef96e544df446144bb1a05bcc7cf.tar.gz
cowboy-cbf7972f10a5ef96e544df446144bb1a05bcc7cf.tar.bz2
cowboy-cbf7972f10a5ef96e544df446144bb1a05bcc7cf.zip
Don't terminate streams that were already terminated
This and the issues in the last two commits were reported by leo2007 on IRC.
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_http2.erl3
1 files changed, 3 insertions, 0 deletions
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, []),