0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00

Add cowboy_protocol:opts() type

Should improve the detection of wrong protocol options.
This commit is contained in:
Loïc Hoguin 2013-05-16 17:56:45 +02:00
parent 2e787fed56
commit 6d1344319a
2 changed files with 20 additions and 4 deletions

View file

@ -37,14 +37,16 @@
-export_type([onresponse_fun/0]).
%% @doc Start an HTTP listener.
-spec start_http(any(), non_neg_integer(), any(), any()) -> {ok, pid()}.
-spec start_http(any(), non_neg_integer(), any(),
cowboy_protocol:opts()) -> {ok, pid()}.
start_http(Ref, NbAcceptors, TransOpts, ProtoOpts)
when is_integer(NbAcceptors), NbAcceptors > 0 ->
ranch:start_listener(Ref, NbAcceptors,
ranch_tcp, TransOpts, cowboy_protocol, ProtoOpts).
%% @doc Start an HTTPS listener.
-spec start_https(any(), non_neg_integer(), any(), any()) -> {ok, pid()}.
-spec start_https(any(), non_neg_integer(), any(),
cowboy_protocol:opts()) -> {ok, pid()}.
start_https(Ref, NbAcceptors, TransOpts, ProtoOpts)
when is_integer(NbAcceptors), NbAcceptors > 0 ->
ranch:start_listener(Ref, NbAcceptors,