aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch_server.erl
diff options
context:
space:
mode:
authorjuhlig <[email protected]>2019-06-24 13:18:31 +0200
committerLoïc Hoguin <[email protected]>2019-07-01 13:20:43 +0200
commit37e64f50df640803625771bc3655b6db6c351493 (patch)
tree63a5d6160295bfca0197193cdeeb2fddd11b9be2 /src/ranch_server.erl
parente8d6401741021f76988091e6dc633afb65ffbe7b (diff)
downloadranch-37e64f50df640803625771bc3655b6db6c351493.tar.gz
ranch-37e64f50df640803625771bc3655b6db6c351493.tar.bz2
ranch-37e64f50df640803625771bc3655b6db6c351493.zip
Add missing specs
Diffstat (limited to 'src/ranch_server.erl')
-rw-r--r--src/ranch_server.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ranch_server.erl b/src/ranch_server.erl
index 8433178..ae68e99 100644
--- a/src/ranch_server.erl
+++ b/src/ranch_server.erl
@@ -169,6 +169,7 @@ count_connections(Ref) ->
%% gen_server.
+-spec init([]) -> {ok, #state{}}.
init([]) ->
ConnMonitors = [{{erlang:monitor(process, Pid), Pid}, {conns_sup, Ref, Id}} ||
[Ref, Id, Pid] <- ets:match(?TAB, {{conns_sup, '$1', '$2'}, '$3'})],
@@ -176,6 +177,7 @@ init([]) ->
[Ref, Pid] <- ets:match(?TAB, {{listener_sup, '$1'}, '$2'})],
{ok, #state{monitors=ConnMonitors++ListenerMonitors}}.
+-spec handle_call(term(), {pid(), reference()}, #state{}) -> {reply, ok | ignore, #state{}}.
handle_call({set_new_listener_opts, Ref, MaxConns, TransOpts, ProtoOpts, StartArgs}, _, State) ->
ets:insert_new(?TAB, {{max_conns, Ref}, MaxConns}),
ets:insert_new(?TAB, {{trans_opts, Ref}, TransOpts}),
@@ -205,9 +207,11 @@ handle_call({set_proto_opts, Ref, Opts}, _, State) ->
handle_call(_Request, _From, State) ->
{reply, ignore, State}.
+-spec handle_cast(_, #state{}) -> {noreply, #state{}}.
handle_cast(_Request, State) ->
{noreply, State}.
+-spec handle_info(term(), #state{}) -> {noreply, #state{}}.
handle_info({'DOWN', MonitorRef, process, Pid, Reason},
State=#state{monitors=Monitors}) ->
{_, TypeRef} = lists:keyfind({MonitorRef, Pid}, 1, Monitors),
@@ -227,9 +231,11 @@ handle_info({'DOWN', MonitorRef, process, Pid, Reason},
handle_info(_Info, State) ->
{noreply, State}.
+-spec terminate(_, #state{}) -> ok.
terminate(_Reason, _State) ->
ok.
+-spec code_change(term() | {down, term()}, #state{}, term()) -> {ok, term()}.
code_change(_OldVsn, State, _Extra) ->
{ok, State}.