aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Fine <[email protected]>2016-07-22 20:15:54 -0400
committerEdwin Fine <[email protected]>2016-07-24 15:03:47 -0400
commit7babe1a82adc9dd1deb1b43074ac184f89fda945 (patch)
treea851e51b92d09d2c25092bd224c1df5f859c8fe7
parent485bc1fbddda0413df6d8b4ad195f1307de863cd (diff)
downloadotp-7babe1a82adc9dd1deb1b43074ac184f89fda945.tar.gz
otp-7babe1a82adc9dd1deb1b43074ac184f89fda945.tar.bz2
otp-7babe1a82adc9dd1deb1b43074ac184f89fda945.zip
Fix httpd_conf:validate_properties/1 for ipfamily
inets:start/2 fails when using the legacy option inet6fb4 with a configuration proplist. It is not translated to inet as documented. This breaks existing code that relies on the documented behavior. This commit fixes the issue by translating inet6fb4 everywhere it is encountered in httpd_conf:validate_properties/1. From inets documentation (http://erlang.org/doc/man/httpd.html): {ipfamily, inet | inet6} Default is inet, legacy option inet6fb4 no longer makes sense and will be translated to inet. Fixes ERL-200.
-rw-r--r--lib/inets/src/http_server/httpd_conf.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/inets/src/http_server/httpd_conf.erl b/lib/inets/src/http_server/httpd_conf.erl
index e5182ca23c..9e54f2b2c5 100644
--- a/lib/inets/src/http_server/httpd_conf.erl
+++ b/lib/inets/src/http_server/httpd_conf.erl
@@ -395,7 +395,8 @@ validate_properties(Properties) ->
%% That is, if property A depends on property B.
%% The only sunch preperty at this time is bind_address that depends
%% on ipfamily.
-validate_properties2(Properties) ->
+validate_properties2(Properties0) ->
+ Properties = fix_ipfamily(Properties0),
case proplists:get_value(bind_address, Properties) of
undefined ->
case proplists:get_value(sock_type, Properties, ip_comm) of
@@ -422,6 +423,15 @@ validate_properties2(Properties) ->
end
end.
+fix_ipfamily(Properties) ->
+ case proplists:get_value(ipfamily, Properties) of
+ undefined ->
+ Properties;
+ IpFamily ->
+ NewProps = proplists:delete(ipfamily, Properties),
+ [{ipfamily, validate_ipfamily(IpFamily)} | NewProps]
+ end.
+
add_inet_defaults(Properties) ->
case proplists:get_value(ipfamily, Properties) of
undefined ->