aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/compiler/diameter_codegen.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2011-12-07 11:50:22 +0100
committerAnders Svensson <[email protected]>2011-12-08 00:45:19 +0100
commitb4ecd2efd32df9d14d3314b705cd1114de7141ae (patch)
tree043af124f7367387110c7ceb4ad181026b076be0 /lib/diameter/src/compiler/diameter_codegen.erl
parente2c8662b4fd5d6100ab301cd6c21f9a8d34b7f71 (diff)
downloadotp-b4ecd2efd32df9d14d3314b705cd1114de7141ae.tar.gz
otp-b4ecd2efd32df9d14d3314b705cd1114de7141ae.tar.bz2
otp-b4ecd2efd32df9d14d3314b705cd1114de7141ae.zip
Fix semantic checks on AVP qualifiers
Didn't quite interpret '*' as RFC 3588 dictates. In particular, the interpretation depends on what's being qualified, a required, optional or fixed AVP.
Diffstat (limited to 'lib/diameter/src/compiler/diameter_codegen.erl')
-rw-r--r--lib/diameter/src/compiler/diameter_codegen.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/diameter/src/compiler/diameter_codegen.erl b/lib/diameter/src/compiler/diameter_codegen.erl
index 2c011376ad..489f521f70 100644
--- a/lib/diameter/src/compiler/diameter_codegen.erl
+++ b/lib/diameter/src/compiler/diameter_codegen.erl
@@ -835,15 +835,15 @@ avp_info(Entry) -> %% {Name, Arity}
[A] -> {A, {0,1}};
{Q,T} ->
{A,_} = avp_info(T),
- {A, arity(Q)}
+ {A, arity(T,Q)}
end.
%% Normalize arity to 1 or {N,X} where N is an integer. A record field
%% for an AVP is list-valued iff the normalized arity is not 1.
-arity('*' = Inf) -> {0, Inf};
-arity({'*', N}) -> {0, N};
-arity({1,1}) -> 1;
-arity(T) -> T.
+arity({{_}}, '*' = Inf) -> {0, Inf};
+arity([_], '*' = Inf) -> {0, Inf};
+arity({_}, '*' = Inf) -> {1, Inf};
+arity(_, {_,_} = Q) -> Q.
prefix(Spec) ->
case orddict:find(prefix, Spec) of