diff options
-rw-r--r-- | src/ranch.erl | 4 | ||||
-rw-r--r-- | src/ranch_listener_sup.erl | 6 | ||||
-rw-r--r-- | src/ranch_ssl.erl | 2 | ||||
-rw-r--r-- | src/ranch_tcp.erl | 2 | ||||
-rw-r--r-- | src/ranch_transport.erl | 2 |
5 files changed, 7 insertions, 9 deletions
diff --git a/src/ranch.erl b/src/ranch.erl index 74497f0..2db4921 100644 --- a/src/ranch.erl +++ b/src/ranch.erl @@ -175,7 +175,7 @@ set_protocol_options(Ref, Opts) -> %% It takes a list of options, a list of allowed keys and an accumulator. %% This accumulator can be used to set default options that should never %% be overriden. --spec filter_options([{atom(), any()} | {atom(), any(), any(), any()}], +-spec filter_options([{atom(), any()} | {raw, any(), any(), any()}], [atom()], Acc) -> Acc when Acc :: [any()]. filter_options([], _, Acc) -> Acc; @@ -200,7 +200,7 @@ set_option_default(Opts, Key, Value) -> end. %% @doc Start the given applications if they were not already started. --spec require(list(module())) -> ok. +-spec require([atom()]) -> ok. require([]) -> ok; require([App|Tail]) -> diff --git a/src/ranch_listener_sup.erl b/src/ranch_listener_sup.erl index 0392105..56df6b7 100644 --- a/src/ranch_listener_sup.erl +++ b/src/ranch_listener_sup.erl @@ -38,13 +38,11 @@ start_link(Ref, NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts) -> init({Ref, NbAcceptors, Transport, TransOpts, Protocol}) -> ConnType = proplists:get_value(connection_type, TransOpts, worker), ChildSpecs = [ - %% conns_sup {ranch_conns_sup, {ranch_conns_sup, start_link, [Ref, ConnType, Transport, Protocol]}, permanent, infinity, supervisor, [ranch_conns_sup]}, - %% acceptors_sup {ranch_acceptors_sup, {ranch_acceptors_sup, start_link, - [Ref, NbAcceptors, Transport, TransOpts] - }, permanent, infinity, supervisor, [ranch_acceptors_sup]} + [Ref, NbAcceptors, Transport, TransOpts]}, + permanent, infinity, supervisor, [ranch_acceptors_sup]} ], {ok, {{rest_for_one, 10, 10}, ChildSpecs}}. diff --git a/src/ranch_ssl.erl b/src/ranch_ssl.erl index 53bcf8a..8fa7358 100644 --- a/src/ranch_ssl.erl +++ b/src/ranch_ssl.erl @@ -197,7 +197,7 @@ send(Socket, Packet) -> ssl:send(Socket, Packet). %% @equiv sendfile(Socket, Filename, 0, 0, []) --spec sendfile(ssl:sslsocket(), file:name_all()) +-spec sendfile(ssl:sslsocket(), file:name_all() | file:fd()) -> {ok, non_neg_integer()} | {error, atom()}. sendfile(Socket, Filename) -> sendfile(Socket, Filename, 0, 0, []). diff --git a/src/ranch_tcp.erl b/src/ranch_tcp.erl index 6bdcdd0..087cf09 100644 --- a/src/ranch_tcp.erl +++ b/src/ranch_tcp.erl @@ -113,7 +113,7 @@ send(Socket, Packet) -> gen_tcp:send(Socket, Packet). %% @equiv sendfile(Socket, File, Offset, Bytes, []) --spec sendfile(inet:socket(), file:name_all()) +-spec sendfile(inet:socket(), file:name_all() | file:fd()) -> {ok, non_neg_integer()} | {error, atom()}. sendfile(Socket, Filename) -> sendfile(Socket, Filename, 0, 0, []). diff --git a/src/ranch_transport.erl b/src/ranch_transport.erl index 6168b35..d557594 100644 --- a/src/ranch_transport.erl +++ b/src/ranch_transport.erl @@ -60,7 +60,7 @@ -callback send(socket(), iodata()) -> ok | {error, atom()}. %% Send a file on a socket. --callback sendfile(socket(), file:name()) +-callback sendfile(socket(), file:name() | file:fd()) -> {ok, non_neg_integer()} | {error, atom()}. %% Send part of a file on a socket. |