aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/include
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-07-25 01:27:58 +0200
committerAnders Svensson <[email protected]>2017-08-03 17:17:37 +0200
commitb3d9e0c09ff9d8f963b6084a84ab120cd423a9ae (patch)
treefa6a4a1318ebd3975fe1964d681eff01817137cc /lib/diameter/include
parenta14ba6581063c4fca2edc36156e07c6582729e2e (diff)
downloadotp-b3d9e0c09ff9d8f963b6084a84ab120cd423a9ae.tar.gz
otp-b3d9e0c09ff9d8f963b6084a84ab120cd423a9ae.tar.bz2
otp-b3d9e0c09ff9d8f963b6084a84ab120cd423a9ae.zip
Redo message decode as a single pass
Decode has previously been two passes: first chunk the message into a reversed list of toplevel diameter_avp records, then fold through the reversed list to build the full result. Various workarounds have made it a bit more convoluted than it should be however. Rework it completely, turning the previous 2-pass tail-recursive implementation into a 1-pass body recursive one. The relay decode still exists in diameter_codec, as a stripped down version of the full decode in diameter_gen.
Diffstat (limited to 'lib/diameter/include')
-rw-r--r--lib/diameter/include/diameter_gen.hrl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/diameter/include/diameter_gen.hrl b/lib/diameter/include/diameter_gen.hrl
index fb6370fe54..548763ec7d 100644
--- a/lib/diameter/include/diameter_gen.hrl
+++ b/lib/diameter/include/diameter_gen.hrl
@@ -26,13 +26,13 @@
%% encode_avps/3
-encode_avps(Name, Vals, Opts) ->
- diameter_gen:encode_avps(Name, Vals, Opts#{module => ?MODULE}).
+encode_avps(Name, Avps, Opts) ->
+ diameter_gen:encode_avps(Name, Avps, Opts#{module => ?MODULE}).
%% decode_avps/2
-decode_avps(Name, Recs, Opts) ->
- diameter_gen:decode_avps(Name, Recs, Opts#{module => ?MODULE}).
+decode_avps(Name, Avps, Opts) ->
+ diameter_gen:decode_avps(Name, Avps, Opts#{module => ?MODULE}).
%% avp/5