aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-05-06 17:24:55 +0300
committerLoïc Hoguin <[email protected]>2015-07-26 18:34:17 +0200
commit9b424fec2bf84a8aac79d021ba02598af28da04d (patch)
tree37b9e09caee3b52ca76631e239e725ffa560b0f9
parent674e5a61e278bac86a6caaaab56dea2cfd5a7cc2 (diff)
downloadcowboy-9b424fec2bf84a8aac79d021ba02598af28da04d.tar.gz
cowboy-9b424fec2bf84a8aac79d021ba02598af28da04d.tar.bz2
cowboy-9b424fec2bf84a8aac79d021ba02598af28da04d.zip
Dialyzer fixes in cowboy_clock
This is what I get for merging blindly! and Fix a compile error introduced in previous commit (cherry-pick)
-rw-r--r--src/cowboy_clock.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cowboy_clock.erl b/src/cowboy_clock.erl
index c81b486..5d9a41a 100644
--- a/src/cowboy_clock.erl
+++ b/src/cowboy_clock.erl
@@ -36,7 +36,7 @@
-record(state, {
universaltime = undefined :: undefined | calendar:datetime(),
rfc1123 = <<>> :: binary(),
- tref = undefined :: undefined | timer:tref()
+ tref = undefined :: undefined | reference()
}).
%% API.
@@ -69,11 +69,11 @@ init([]) ->
ets:insert(?MODULE, {rfc1123, B}),
{ok, #state{universaltime=T, rfc1123=B, tref=TRef}}.
--spec handle_call(any(), _, State)
- -> {reply, ignored, State} | {stop, normal, stopped, State}
+-type from() :: {pid(), term()}.
+-spec handle_call
+ (stop, from(), State) -> {stop, normal, stopped, State}
when State::#state{}.
-handle_call(stop, _From, State=#state{tref=TRef}) ->
- {ok, cancel} = timer:cancel(TRef),
+handle_call(stop, _From, State) ->
{stop, normal, stopped, State};
handle_call(_Request, _From, State) ->
{reply, ignored, State}.
@@ -85,7 +85,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),
T = erlang:universaltime(),
B2 = update_rfc1123(B1, Prev, T),
ets:insert(?MODULE, {rfc1123, B2}),