aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter
diff options
context:
space:
mode:
Diffstat (limited to 'lib/diameter')
-rw-r--r--lib/diameter/include/diameter_gen.hrl25
1 files changed, 10 insertions, 15 deletions
diff --git a/lib/diameter/include/diameter_gen.hrl b/lib/diameter/include/diameter_gen.hrl
index 1b79aa6d32..4624d42c6f 100644
--- a/lib/diameter/include/diameter_gen.hrl
+++ b/lib/diameter/include/diameter_gen.hrl
@@ -635,8 +635,11 @@ pack(Arity, FieldName, Avp, {Rec, _} = Acc) ->
%% pack/5
-pack(undefined, 1, FieldName, Avp, Acc) ->
- p(FieldName, fun(V) -> V end, Avp, Acc);
+pack(undefined, 1, 'AVP' = F, Avp, {Rec, Failed}) -> %% unlikely
+ {'#set-'({F, Avp}, Rec), Failed};
+
+pack(undefined, 1, F, #diameter_avp{value = V}, {Rec, Failed}) ->
+ {'#set-'({F, V}, Rec), Failed};
%% 3588:
%%
@@ -649,25 +652,17 @@ pack(undefined, 1, FieldName, Avp, Acc) ->
pack(_, 1, _, Avp, {Rec, Failed}) ->
{Rec, [{5009, Avp} | Failed]};
-pack(L, {_, Max}, FieldName, Avp, Acc) ->
+
+pack(L, {_, Max}, F, Avp, {Rec, Failed}) ->
case '*' /= Max andalso has_prefix(Max, L) of
true ->
- {Rec, Failed} = Acc,
{Rec, [{5009, Avp} | Failed]};
+ false when F == 'AVP' ->
+ {'#set-'({F, [Avp | L]}, Rec), Failed};
false ->
- p(FieldName, fun(V) -> [V|L] end, Avp, Acc)
+ {'#set-'({F, [Avp#diameter_avp.value | L]}, Rec), Failed}
end.
-%% p/4
-
-p(F, Fun, Avp, {Rec, Failed}) ->
- {'#set-'({F, Fun(value(F, Avp))}, Rec), Failed}.
-
-value('AVP', Avp) ->
- Avp;
-value(_, Avp) ->
- Avp#diameter_avp.value.
-
%% ---------------------------------------------------------------------------
%% # grouped_avp/3
%% ---------------------------------------------------------------------------