From 6eecfd055d6717072a8c557368d80e4b2323fa7f Mon Sep 17 00:00:00 2001 From: Ethan Yang Date: Wed, 6 Jan 2016 17:02:32 +0800 Subject: [PATCH 1/2] 'Unable to service recovery request when requested count is bigger than configured maximum request count' now is a warning instead of an error. --- src/molderl_recovery.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/molderl_recovery.erl b/src/molderl_recovery.erl index 6349044..5d32dde 100644 --- a/src/molderl_recovery.erl +++ b/src/molderl_recovery.erl @@ -91,6 +91,9 @@ handle_info({udp, _Client, IP, Port, < + lager:warning("[molderl] Unable to service recovery request from ~p because ~s. Ignoring.", [IP, Reason]) + {error, Reason} -> lager:error("[molderl] Unable to service recovery request from ~p because ~s. Ignoring.", [IP, Reason]) end, @@ -151,10 +154,10 @@ terminate(Reason, State) -> %% request count is smaller than the maximum request count. %% ------------------------------------------------------------ -spec validate_request(integer(), integer(), pos_integer(), pos_integer()) -> - 'ok' | {'error', string()}. + 'ok' | {'warning', string()} | {'error', string()}. validate_request(_SeqNum, Count, _MaxSeqNum, MaxCount) when Count>MaxCount -> Fmt = "requested count ~p is bigger than configured maximum request count ~p", - {error, io_lib:format(Fmt, [Count, MaxCount])}; + {warning, io_lib:format(Fmt, [Count, MaxCount])}; validate_request(SeqNum, _Count, _MaxSeqNum, _MaxCount) when SeqNum =< 0 -> Fmt = "requested sequence number ~p is smaller or equal to zero", {error, io_lib:format(Fmt, [SeqNum])}; From 41d96efdebacc48d8d4d0860b5a816978a4c6066 Mon Sep 17 00:00:00 2001 From: Ethan Yang Date: Wed, 6 Jan 2016 17:15:52 +0800 Subject: [PATCH 2/2] add missing semicolon --- src/molderl_recovery.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/molderl_recovery.erl b/src/molderl_recovery.erl index 5d32dde..458506d 100644 --- a/src/molderl_recovery.erl +++ b/src/molderl_recovery.erl @@ -92,7 +92,7 @@ handle_info({udp, _Client, IP, Port, < - lager:warning("[molderl] Unable to service recovery request from ~p because ~s. Ignoring.", [IP, Reason]) + lager:warning("[molderl] Unable to service recovery request from ~p because ~s. Ignoring.", [IP, Reason]); {error, Reason} -> lager:error("[molderl] Unable to service recovery request from ~p because ~s. Ignoring.", [IP, Reason])