aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-08-18 17:15:45 +0200
committerLoïc Hoguin <[email protected]>2015-08-18 17:15:45 +0200
commit0d5d855da3d0b2d508fae4258b125a3a5ab7b306 (patch)
treec504903fe15cb34768b34542f3dbc5a3449fb999 /src/ranch.erl
parentd440a2c1d26e4f0770a66279de151806b1ad5ac2 (diff)
downloadranch-0d5d855da3d0b2d508fae4258b125a3a5ab7b306.tar.gz
ranch-0d5d855da3d0b2d508fae4258b125a3a5ab7b306.tar.bz2
ranch-0d5d855da3d0b2d508fae4258b125a3a5ab7b306.zip
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.
Diffstat (limited to 'src/ranch.erl')
-rw-r--r--src/ranch.erl6
1 files changed, 6 insertions, 0 deletions
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)];