diff options
author | Anders Svensson <[email protected]> | 2013-02-12 17:46:38 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2013-02-16 22:46:45 +0100 |
commit | 61b9efd8b4cf35dce44ec2fefd26339d2d20cb3c (patch) | |
tree | 2157f468910dd1df0233ab710dccaf5dd4e655e8 /lib/diameter/test/diameter_traffic_SUITE.erl | |
parent | df2189c22f7ca7660496e46322d8b825e9f28ba3 (diff) | |
download | otp-61b9efd8b4cf35dce44ec2fefd26339d2d20cb3c.tar.gz otp-61b9efd8b4cf35dce44ec2fefd26339d2d20cb3c.tar.bz2 otp-61b9efd8b4cf35dce44ec2fefd26339d2d20cb3c.zip |
Be less brutal in setting Result-Code/Failed-AVP
When receiving a request for which errors have been detected during
decode, diameter previously used the errors list in the decoded
diameter_packet record to unconditionally set Result-Code and Failed-AVP
in the outgoing answer. It wasn't particularly delicate in doing so
however and would happily set a 5xxx Result-Code even if a
handle_request callback returned an answer-message, leading to an encode
error. This behaviour became even less endearing as of commit ac452e28,
which made it possible to handle_request to take place even for protocol
errors. (ie. When a callback typically should return an answer-message.)
This commit fixes the behaviour by only setting a value that's
appropriate for the answer in question, either a 3xxx or a 5xxx,
depending on if the answer's an answer-message or not. It also allows
handle_request to prevent diameter from setting anything by setting
errors = false in a returned diameter_packet. Ideally it should have
been errors = [] but the empty list is the default value for the errors
field and changing the default (ideally there shouldn't have been one)
would require recompilation of all modules including diameter.hrl:
choose the less attractive 'false' to avoid such backwards
incompatibility.
The request reception is also refactored somewhat to shorten some call
chains.
Diffstat (limited to 'lib/diameter/test/diameter_traffic_SUITE.erl')
0 files changed, 0 insertions, 0 deletions