aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-07-10 20:32:02 +0200
committerAnders Svensson <[email protected]>2017-08-03 17:14:29 +0200
commit246a5d8611e258119fc6bdc6c52772539c8b09ca (patch)
treea000ec4a08612fe3cd0d658f6db8478807be84ce /lib
parentdec19d6f572a564502fb81c8f1ada5a470429d97 (diff)
downloadotp-246a5d8611e258119fc6bdc6c52772539c8b09ca.tar.gz
otp-246a5d8611e258119fc6bdc6c52772539c8b09ca.tar.bz2
otp-246a5d8611e258119fc6bdc6c52772539c8b09ca.zip
Don't count AVPs unnecessarily at encode
Stop counting when there can be no arity errors.
Diffstat (limited to 'lib')
-rw-r--r--lib/diameter/src/base/diameter_gen.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/diameter/src/base/diameter_gen.erl b/lib/diameter/src/base/diameter_gen.erl
index 313be5f215..a7dc3aaec3 100644
--- a/lib/diameter/src/base/diameter_gen.erl
+++ b/lib/diameter/src/base/diameter_gen.erl
@@ -127,6 +127,10 @@ enc(_, AvpName, _, Min, N, _, [], _, _)
enc(_, _, _, _, _, _, [], _, _) ->
[];
+enc(Name, AvpName, H, Min, N, '*', Vs, Opts, Mod)
+ when Min =< N ->
+ [enc1(Name, AvpName, H, V, Opts, Mod) || V <- Vs];
+
enc(_, AvpName, _, _, N, Max, _, _, _)
when Max =< N ->
?THROW([repeated_avp_excessive_arity, AvpName, Max]);