From dd34fc63c87c91acc086b5c02ebf29d6ae2d2c5f Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 25 Oct 2015 00:56:05 +0200 Subject: [PATCH] mod_http_upload_quota: Log unexpected 'sweep' Log an error message if the mod_http_upload_quota process receives a 'sweep' message despite the "max_days" option not being specified. --- mod_http_upload/src/mod_http_upload_quota.erl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod_http_upload/src/mod_http_upload_quota.erl b/mod_http_upload/src/mod_http_upload_quota.erl index 9fb5760..b35c802 100644 --- a/mod_http_upload/src/mod_http_upload_quota.erl +++ b/mod_http_upload/src/mod_http_upload_quota.erl @@ -190,11 +190,10 @@ handle_cast(Request, State) -> -spec handle_info(_, state()) -> {noreply, state()}. -handle_info(sweep, #state{max_days = infinity} = State) -> % Shouldn't happen. - {noreply, State}; handle_info(sweep, #state{server_host = ServerHost, docroot = DocRoot, - max_days = MaxDays} = State) -> + max_days = MaxDays} = State) + when is_integer(MaxDays), MaxDays > 0 -> ?DEBUG("Got 'sweep' message for ~s", [ServerHost]), case file:list_dir(DocRoot) of {ok, Entries} ->