aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-04-22 08:46:48 +0200
committerAnders Svensson <[email protected]>2017-06-12 16:13:52 +0200
commit2ae059913dc332e5655f44d1b2292342cb470fc1 (patch)
tree4301b9a6d822b60380ee24425315066ef9187cc6 /lib/diameter/src
parentc83d5ac4d4df41924b52cb577c255cd0c23f36ed (diff)
downloadotp-2ae059913dc332e5655f44d1b2292342cb470fc1.tar.gz
otp-2ae059913dc332e5655f44d1b2292342cb470fc1.tar.bz2
otp-2ae059913dc332e5655f44d1b2292342cb470fc1.zip
Don't prepend bit for sub binary optimization
Diffstat (limited to 'lib/diameter/src')
-rw-r--r--lib/diameter/src/base/diameter_codec.erl17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/diameter/src/base/diameter_codec.erl b/lib/diameter/src/base/diameter_codec.erl
index 43cc49903d..789395abe9 100644
--- a/lib/diameter/src/base/diameter_codec.erl
+++ b/lib/diameter/src/base/diameter_codec.erl
@@ -617,7 +617,7 @@ collect_avps(Code, VendorId, M, P, Len, Pad, Rest, N, Acc) ->
vendor_id = VendorId,
is_mandatory = M,
need_encryption = P,
- data = <<0:1, Rest/binary>>,
+ data = {5014, Rest},
index = N},
[Avp | Acc]
end.
@@ -705,23 +705,18 @@ pack_avp(#diameter_avp{code = undefined, data = B})
Sz = min(5, size(B)),
<<B:Sz/binary, 0:(5-Sz)/unit:8, Len:24, 0:(Len-8)/unit:8>>;
+%% Ignoring errors in Failed-AVP or during a relay encode.
+pack_avp(#diameter_avp{data = {5014, Data}} = A) ->
+ pack_data(Data, A);
+
pack_avp(#diameter_avp{data = Data} = A) ->
- pack_bits(Data, A).
+ pack_data(Data, A).
header_length(<<_:32, 1:1, _/bits>>) ->
12;
header_length(_) ->
8.
-%% pack_bits/2
-
-%% Ignoring errors in Failed-AVP or during a relay encode.
-pack_bits(<<0:1, B/binary>>, Avp) ->
- pack_bits(B, Avp);
-
-pack_bits(Data, Avp) ->
- pack_data(Data, Avp).
-
%% pack_data/2
pack_data(Data, #diameter_avp{code = Code,