diff --git a/src/cowboy_clock.erl b/src/cowboy_clock.erl index e2cdf62d..b4843944 100644 --- a/src/cowboy_clock.erl +++ b/src/cowboy_clock.erl @@ -93,7 +93,7 @@ handle_cast(_Msg, State) -> -spec handle_info(any(), State) -> {noreply, State} when State::#state{}. handle_info(update, #state{universaltime=Prev, rfc1123=B1, tref=TRef0}) -> %% Cancel the timer in case an external process sent an update message. - _ = erlang:cancel_timer(TRef0), + _ = erlang:cancel_timer(TRef0, [{async, true}, {info, false}]), T = erlang:universaltime(), B2 = update_rfc1123(B1, Prev, T), ets:insert(?MODULE, {rfc1123, B2}), diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl index 9c92ec5a..b9cfb0ee 100644 --- a/src/cowboy_http.erl +++ b/src/cowboy_http.erl @@ -327,7 +327,7 @@ cancel_timeout(State=#state{timer=TimerRef}) -> _ -> %% Do a synchronous cancel and remove the message if any %% to avoid receiving stray messages. - _ = erlang:cancel_timer(TimerRef), + _ = erlang:cancel_timer(TimerRef, [{async, false}, {info, false}]), receive {timeout, TimerRef, _} -> ok after 0 -> diff --git a/src/cowboy_websocket.erl b/src/cowboy_websocket.erl index 3cc4d303..f1853a68 100644 --- a/src/cowboy_websocket.erl +++ b/src/cowboy_websocket.erl @@ -377,7 +377,7 @@ before_loop(State, HandlerState, ParseState) -> loop_timeout(State=#state{opts=Opts, timeout_ref=PrevRef}) -> _ = case PrevRef of undefined -> ignore; - PrevRef -> erlang:cancel_timer(PrevRef) + PrevRef -> erlang:cancel_timer(PrevRef, [{async, true}, {info, false}]) end, case maps:get(idle_timeout, Opts, 60000) of infinity ->