Skip to content

Commit

Permalink
Fix idle_timeout changes for HTTP/2
Browse files Browse the repository at this point in the history
  • Loading branch information
essen committed Jan 13, 2025
1 parent 25f887a commit 8bb94de
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/cowboy_http2.erl
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,13 @@ set_idle_timeout(State=#state{http2_status=Status, timer=TimerRef}, _)
TimerRef =/= undefined ->
State;
set_idle_timeout(State=#state{opts=Opts}, TimeoutNum) ->
set_timeout(State#state{idle_timeout_num=TimeoutNum},
maps:get(idle_timeout, Opts, 60000), idle_timeout).
case maps:get(idle_timeout, Opts, 60000) of
infinity ->
State#state{timer=undefined};
Timeout ->
set_timeout(State#state{idle_timeout_num=TimeoutNum},
Timeout div ?IDLE_TIMEOUT_TICKS, idle_timeout)
end.

set_timeout(State=#state{timer=TimerRef0}, Timeout, Message) ->
ok = case TimerRef0 of
Expand Down

0 comments on commit 8bb94de

Please sign in to comment.