aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_server/httpd_conf.erl
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2012-11-16 11:54:15 +0100
committerFredrik Gustafsson <[email protected]>2012-11-16 11:54:15 +0100
commit9c3a39fa8a5edfaea75226579e28aab49506902c (patch)
tree780b40dc7e5d97ed095a422745efdf235bf2f82a /lib/inets/src/http_server/httpd_conf.erl
parent7e7d5d522f1a46d7bdda3980f6e9c5649a35eca6 (diff)
parent5431f00a394e4ebfd2b1691afcffdc617bb06fd1 (diff)
downloadotp-9c3a39fa8a5edfaea75226579e28aab49506902c.tar.gz
otp-9c3a39fa8a5edfaea75226579e28aab49506902c.tar.bz2
otp-9c3a39fa8a5edfaea75226579e28aab49506902c.zip
Merge branch 'fredrik/inets/slowdos/OTP-10392' into maint
* fredrik/inets/slowdos/OTP-10392: Increased waiting time to check if socket is down Fine adjustments of slowdos alg Changes to slowdos testcase Doc for test case slowdose Bumped version nr Added testcases för minimum_bytes_per_second option Reduced checking of bytes per second to every second Documentation for minimum_bytes_per_seconds option Changed property to minimum_bytes_per_second and checking if is integer on start Changed to Bytes Per Second when checking clients rate, new options {byte_limit, integer()} Option {bit_limit, integer()} to close sockets where clients are too slow
Diffstat (limited to 'lib/inets/src/http_server/httpd_conf.erl')
-rw-r--r--lib/inets/src/http_server/httpd_conf.erl15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/inets/src/http_server/httpd_conf.erl b/lib/inets/src/http_server/httpd_conf.erl
index b575d7331b..884e3defb8 100644
--- a/lib/inets/src/http_server/httpd_conf.erl
+++ b/lib/inets/src/http_server/httpd_conf.erl
@@ -483,7 +483,7 @@ validate_properties(Properties) ->
case mandatory_properties(Properties) of
ok ->
%% Second, check that property dependency are ok
- {ok, validate_properties2(Properties)};
+ {ok, check_minimum_bytes_per_second(validate_properties2(Properties))};
Error ->
throw(Error)
end.
@@ -522,7 +522,18 @@ validate_properties2(Properties) ->
throw(Error)
end
end.
-
+check_minimum_bytes_per_second(Properties) ->
+ case proplists:get_value(minimum_bytes_per_second, Properties, false) of
+ false ->
+ Properties;
+ Nr ->
+ case is_integer(Nr) of
+ false ->
+ throw({error, {minimum_bytes_per_second, is_not_integer}});
+ _ ->
+ Properties
+ end
+ end.
mandatory_properties(ConfigList) ->
a_must(ConfigList, [server_name, port, server_root, document_root]).