From c2c00fdd4de1b8883e47ec1b5b048659ef033302 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Fri, 23 May 2014 00:24:41 +0200 Subject: Do best-effort decode of Failed-AVP Commit 4ce2d3a6 (diameter-1.4.2, OTP-11007) disabled the decode of values in Failed-AVP components since any error caused the decode of Failed-AVP itself to fail. This is less than useful since (1) we should be able to decode it given that we've sent it (modulo mangling on the way to the peer and back), and (2) it's not unheard of to examine Failed-AVP to see what the peer objected to. This commits adds a best-effort decode: decode if possible, otherwise not, using the same abuse of the process dictionary as commit bbdb027c. --- lib/diameter/src/base/diameter_codec.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/diameter/src') diff --git a/lib/diameter/src/base/diameter_codec.erl b/lib/diameter/src/base/diameter_codec.erl index 0ca4a84d21..06a4f5de64 100644 --- a/lib/diameter/src/base/diameter_codec.erl +++ b/lib/diameter/src/base/diameter_codec.erl @@ -593,7 +593,8 @@ pack_avp(#diameter_avp{code = undefined, data = B}) Len = size(<> = <>), <>; -%% ... from a dictionary compiled against old code (diameter_gen) ... +%% ... from a dictionary compiled against old code in diameter_gen ... +%% ... when ignoring errors in Failed-AVP ... pack_avp(#diameter_avp{data = <<0:1, B/binary>>} = A) -> pack_avp(A#diameter_avp{data = B}); -- cgit v1.2.3