diff options
author | Loïc Hoguin <[email protected]> | 2018-08-13 13:18:07 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-08-13 13:18:07 +0200 |
commit | 4f96549fbf01b631ebe47021f03a9d40f894ef16 (patch) | |
tree | 5f84c893b137856ad9e9de5067986cc4817b0ec4 | |
parent | d0fad24657711cf584da61b5163c29fdafbd9201 (diff) | |
download | ranch-4f96549fbf01b631ebe47021f03a9d40f894ef16.tar.gz ranch-4f96549fbf01b631ebe47021f03a9d40f894ef16.tar.bz2 ranch-4f96549fbf01b631ebe47021f03a9d40f894ef16.zip |
Export the function ranch:normalize_opts/1
This can be used by Cowboy to better deal with the switch
to maps for transport options and avoid the log message
when using lists.
-rw-r--r-- | src/ranch.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ranch.erl b/src/ranch.erl index ed52b73..a0055e0 100644 --- a/src/ranch.erl +++ b/src/ranch.erl @@ -16,6 +16,7 @@ -export([start_listener/5]). -export([start_listener/6]). +-export([normalize_opts/1]). -export([stop_listener/1]). -export([suspend_listener/1]). -export([resume_listener/1]). @@ -111,6 +112,7 @@ start_listener(Ref, NumAcceptors, Transport, TransOpts0, Protocol, ProtoOpts) start_listener(Ref, Transport, TransOpts#{num_acceptors => NumAcceptors}, Protocol, ProtoOpts). +-spec normalize_opts(opts()) -> opts(). normalize_opts(Map) when is_map(Map) -> Map; normalize_opts(List0) when is_list(List0) -> |