aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_acceptor.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-05-25 23:02:40 +0200
committerLoïc Hoguin <[email protected]>2011-05-25 23:02:40 +0200
commit3e55cb62c9053895412b1cf2a65d54ef90eda34c (patch)
tree0ac9963ba35359b928a594fbde02564e5893daea /src/cowboy_acceptor.erl
parent0720d6b9e3c8655b6222a84a2f37fcab04b3dd94 (diff)
downloadcowboy-3e55cb62c9053895412b1cf2a65d54ef90eda34c.tar.gz
cowboy-3e55cb62c9053895412b1cf2a65d54ef90eda34c.tar.bz2
cowboy-3e55cb62c9053895412b1cf2a65d54ef90eda34c.zip
Refresh the type specifications.
Following discussions on #erlounge. Also fixes compilation in R14B03 and fixes a few underspecs dialyzer warnings.
Diffstat (limited to 'src/cowboy_acceptor.erl')
-rw-r--r--src/cowboy_acceptor.erl12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/cowboy_acceptor.erl b/src/cowboy_acceptor.erl
index 9bcc733..830828e 100644
--- a/src/cowboy_acceptor.erl
+++ b/src/cowboy_acceptor.erl
@@ -18,9 +18,8 @@
%% API.
--spec start_link(LSocket::inet:socket(), Transport::module(),
- Protocol::module(), Opts::term(),
- MaxConns::non_neg_integer(), ReqsSup::pid()) -> {ok, Pid::pid()}.
+-spec start_link(inet:socket(), module(), module(), any(),
+ non_neg_integer(), pid()) -> {ok, pid()}.
start_link(LSocket, Transport, Protocol, Opts, MaxConns, ReqsSup) ->
Pid = spawn_link(?MODULE, acceptor,
[LSocket, Transport, Protocol, Opts, MaxConns, ReqsSup]),
@@ -28,9 +27,8 @@ start_link(LSocket, Transport, Protocol, Opts, MaxConns, ReqsSup) ->
%% Internal.
--spec acceptor(LSocket::inet:socket(), Transport::module(),
- Protocol::module(), Opts::term(),
- MaxConns::non_neg_integer(), ReqsSup::pid()) -> no_return().
+-spec acceptor(inet:socket(), module(), module(), any(),
+ non_neg_integer(), pid()) -> no_return().
acceptor(LSocket, Transport, Protocol, Opts, MaxConns, ReqsSup) ->
case Transport:accept(LSocket, 2000) of
{ok, CSocket} ->
@@ -47,7 +45,7 @@ acceptor(LSocket, Transport, Protocol, Opts, MaxConns, ReqsSup) ->
end,
?MODULE:acceptor(LSocket, Transport, Protocol, Opts, MaxConns, ReqsSup).
--spec limit_reqs(MaxConns::non_neg_integer(), ReqsSup::pid()) -> ok.
+-spec limit_reqs(non_neg_integer(), pid()) -> ok.
limit_reqs(MaxConns, ReqsSup) ->
Counts = supervisor:count_children(ReqsSup),
Active = lists:keyfind(active, 1, Counts),