From 0d5d855da3d0b2d508fae4258b125a3a5ab7b306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 18 Aug 2015 17:15:45 +0200 Subject: Update the list of allowed transport options We are now up to date with regard to transport options we should accept for the listening socket. Documentation of existing options has been updated with regard to recent changes in the OTP docs and type specifications. --- src/ranch.erl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ranch.erl') diff --git a/src/ranch.erl b/src/ranch.erl index fc9bad3..3fbb9a2 100644 --- a/src/ranch.erl +++ b/src/ranch.erl @@ -131,11 +131,17 @@ filter_options(UserOptions, AllowedKeys, DefaultOptions) -> AllowedOptions = filter_user_options(UserOptions, AllowedKeys), lists:foldl(fun merge_options/2, DefaultOptions, AllowedOptions). +%% 2-tuple options. filter_user_options([Opt = {Key, _}|Tail], AllowedKeys) -> case lists:member(Key, AllowedKeys) of true -> [Opt|filter_user_options(Tail, AllowedKeys)]; false -> filter_user_options(Tail, AllowedKeys) end; +%% Special option forms. +filter_user_options([inet|Tail], AllowedKeys) -> + [inet|filter_user_options(Tail, AllowedKeys)]; +filter_user_options([inet6|Tail], AllowedKeys) -> + [inet6|filter_user_options(Tail, AllowedKeys)]; filter_user_options([Opt = {raw, _, _, _}|Tail], AllowedKeys) -> case lists:member(raw, AllowedKeys) of true -> [Opt|filter_user_options(Tail, AllowedKeys)]; -- cgit v1.2.3