From 4f96549fbf01b631ebe47021f03a9d40f894ef16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 13 Aug 2018 13:18:07 +0200 Subject: 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. --- src/ranch.erl | 2 ++ 1 file changed, 2 insertions(+) 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) -> -- cgit v1.2.3