aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-04-17 09:01:25 +0200
committerAnders Svensson <[email protected]>2017-06-12 16:13:52 +0200
commit8c975c3b325c6fa4926c1d12fba0b48e281a08cd (patch)
tree4785a4427af429f07bddcf1f9ebe88faa63c27ff /lib/diameter/src
parentb51872b742b18bcb0c53aaeb09713a46ec91f788 (diff)
downloadotp-8c975c3b325c6fa4926c1d12fba0b48e281a08cd.tar.gz
otp-8c975c3b325c6fa4926c1d12fba0b48e281a08cd.tar.bz2
otp-8c975c3b325c6fa4926c1d12fba0b48e281a08cd.zip
Fix encode of Grouped AVP as {Dict, Name, Data}
This is a special case to allow encode of something other than an iolist. Eg. #diameter_avp{data = {diameter_gen_base_rfc6733, 'Proxy-Info', [{'Proxy-Host', "HOST"}, {'Proxy-State', "STATE"}]}} Only worked as expected for AVPs of type other than Grouped.
Diffstat (limited to 'lib/diameter/src')
-rw-r--r--lib/diameter/src/base/diameter_codec.erl6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/diameter/src/base/diameter_codec.erl b/lib/diameter/src/base/diameter_codec.erl
index 8f313e8e39..f7ba9bd33f 100644
--- a/lib/diameter/src/base/diameter_codec.erl
+++ b/lib/diameter/src/base/diameter_codec.erl
@@ -675,10 +675,8 @@ pack_avp(#diameter_avp{data = {{_,_,_} = T, Bin}})
when is_binary(Bin) ->
pack_avp(T, Bin);
-pack_avp(#diameter_avp{data = {Dict, Name, Value}} = A) ->
- {Code, _Flags, Vid} = Hdr = Dict:avp_header(Name),
- {Name, Type} = Dict:avp_name(Code, Vid),
- pack_avp(A#diameter_avp{data = {Hdr, {Type, Value}}});
+pack_avp(#diameter_avp{data = {Dict, Name, Data}}) ->
+ pack_avp(Dict:avp_header(Name), Dict:avp(encode, Data, Name));
%% ... with a truncated header ...
pack_avp(#diameter_avp{code = undefined, data = B})