aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gun_http2.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gun_http2.erl b/src/gun_http2.erl
index 0feb40e..22654ca 100644
--- a/src/gun_http2.erl
+++ b/src/gun_http2.erl
@@ -963,11 +963,13 @@ closing(#http2_state{opts=Opts}) ->
Timeout = maps:get(closing_timeout, Opts, 15000),
{closing, Timeout}.
-close(Reason0, State=#http2_state{streams=Streams}, _, EvHandlerState) ->
+close(Reason0, State=#http2_state{http2_machine=HTTP2Machine, streams=Streams},
+ _, EvHandlerState) ->
Reason = close_reason(Reason0),
_ = maps:fold(fun(_, Stream, _) ->
close_stream(State, Stream, Reason)
end, [], Streams),
+ cow_http2_machine:terminate(HTTP2Machine),
EvHandlerState.
%% @todo This can get {error,closed} leading to {closed,{error,closed}}.