aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2025-04-10 15:16:35 +0200
committerLoïc Hoguin <[email protected]>2025-04-10 15:16:35 +0200
commitfc7f8220797fcaf1b36204445616da7c6beed798 (patch)
treec9b62fc374ffe82e66152cb95739a949ff566812 /src
parent403a0af4cd8dd378c500e5ec7604bcc68c5ee5b8 (diff)
downloadgun-fc7f8220797fcaf1b36204445616da7c6beed798.tar.gz
gun-fc7f8220797fcaf1b36204445616da7c6beed798.tar.bz2
gun-fc7f8220797fcaf1b36204445616da7c6beed798.zip
Cleanup HTTP/2 timeouts on close to avoid stray messages
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}}.