diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-04-30 19:01:47 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-04-30 19:01:47 +0300 |
commit | fddd6110e00df12c99a20a2cc9d074f5f4f1f965 (patch) | |
tree | 366575b855f1b2013db7eeb02ecb213f81c98c1f /src/mod_http_upload_quota.erl | |
parent | Merge branch 'new-option-validation' (diff) |
Don't validate an option in gen_mod:get*opt() functions
The changes are very similar to those from previous commit:
* Now there is no need to pass validating function in
gen_mod:get_opt() and gen_mod:get_module_opt() functions,
because the modules' configuration keeps already validated values.
* New functions gen_mod:get_opt/2 and gen_mod:get_module_opt/3 are
introduced.
* Functions gen_mod:get_opt/4 and get_module_opt/5 are deprecated.
If the functions are still called, the "function" argument is
simply ignored.
* Validating callback Mod:listen_opt_type/1 is introduced to validate
listening options at startup.
Diffstat (limited to 'src/mod_http_upload_quota.erl')
-rw-r--r-- | src/mod_http_upload_quota.erl | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/mod_http_upload_quota.erl b/src/mod_http_upload_quota.erl index 8d79d16d..10243ac0 100644 --- a/src/mod_http_upload_quota.erl +++ b/src/mod_http_upload_quota.erl @@ -105,18 +105,11 @@ depends(_Host, _Opts) -> init([ServerHost, Opts]) -> process_flag(trap_exit, true), AccessSoftQuota = gen_mod:get_opt(access_soft_quota, Opts, - fun acl:shaper_rules_validator/1, soft_upload_quota), AccessHardQuota = gen_mod:get_opt(access_hard_quota, Opts, - fun acl:shaper_rules_validator/1, hard_upload_quota), - MaxDays = gen_mod:get_opt(max_days, Opts, - fun(I) when is_integer(I), I > 0 -> I; - (infinity) -> infinity - end, - infinity), + MaxDays = gen_mod:get_opt(max_days, Opts, infinity), DocRoot1 = gen_mod:get_module_opt(ServerHost, mod_http_upload, docroot, - fun iolist_to_binary/1, <<"@HOME@/upload">>), DocRoot2 = mod_http_upload:expand_home(str:strip(DocRoot1, right, $/)), DocRoot3 = mod_http_upload:expand_host(DocRoot2, ServerHost), |