diff options
author | Fredrik Gustafsson <[email protected]> | 2012-11-16 11:55:03 +0100 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2012-11-16 11:55:03 +0100 |
commit | 8d0a8ed931deec5a52eaf3e63a1e99a9ed0aeba8 (patch) | |
tree | bdd0c3ff342d4311d196ef4e4fd243ce72fa575b /lib/inets/src/http_server/httpd_conf.erl | |
parent | d3ceb8f5194ff323971163d7758bcbbde74cd0ee (diff) | |
parent | 9c3a39fa8a5edfaea75226579e28aab49506902c (diff) | |
download | otp-8d0a8ed931deec5a52eaf3e63a1e99a9ed0aeba8.tar.gz otp-8d0a8ed931deec5a52eaf3e63a1e99a9ed0aeba8.tar.bz2 otp-8d0a8ed931deec5a52eaf3e63a1e99a9ed0aeba8.zip |
Merge branch 'maint'
* maint:
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.erl | 15 |
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 747118431e..a97bbd9b25 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]). |