aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_protocol.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cowboy_http_protocol.erl')
-rw-r--r--src/cowboy_http_protocol.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl
index 816c825..c8edf12 100644
--- a/src/cowboy_http_protocol.erl
+++ b/src/cowboy_http_protocol.erl
@@ -324,16 +324,15 @@ handler_loop_timeout(State=#state{loop_timeout=Timeout,
loop_timeout_ref=PrevRef}) ->
_ = case PrevRef of undefined -> ignore; PrevRef ->
erlang:cancel_timer(PrevRef) end,
- TRef = make_ref(),
- erlang:send_after(Timeout, self(), {?MODULE, timeout, TRef}),
+ TRef = erlang:start_timer(Timeout, self(), ?MODULE),
State#state{loop_timeout_ref=TRef}.
-spec handler_loop(any(), #http_req{}, #state{}) -> ok.
handler_loop(HandlerState, Req, State=#state{loop_timeout_ref=TRef}) ->
receive
- {?MODULE, timeout, TRef} ->
+ {timeout, TRef, ?MODULE} ->
terminate_request(HandlerState, Req, State);
- {?MODULE, timeout, OlderTRef} when is_reference(OlderTRef) ->
+ {timeout, OlderTRef, ?MODULE} when is_reference(OlderTRef) ->
handler_loop(HandlerState, Req, State);
Message ->
handler_call(HandlerState, Req, State, Message)