xinbc / jdiameter

Automatically exported from code.google.com/p/jdiameter
0 stars 0 forks source link

The Proxy Info AVP is not copied correctly in the answer #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Just receive a request with a Proxy Info AVP, and in the answer, it is 
copied wrongly, is not copied as a group, but each element separately
2.
3.

What is the expected output? What do you see instead?
The expected output is the answer with a PROXY_INFO AVP containing a PROXY_HOST 
and PROXY_STATE AVPs inside. 
What I see is the PROXY_HOST and PROXY_STATE AVPs without the PROXY_INFO group.

What version of the product are you using? On what operating system?
1.5.0. It does not appear to be fixed later.

Please provide any additional information below.
I think the problem may be in 
org.jdiameter.client.impl.parse.MessageParser.java, code:

    // Copy proxy information
    {
      avp = prnMessage.getAvps().getAvp(Avp.PROXY_INFO);
      if (avp != null) {
        AvpSet avps;
        try {
          avps = avp.getGrouped();
          for (Avp avpp : avps) {
            newMessage.getAvps().addAvp(new AvpImpl(avpp));
          }
        }
        catch (AvpDataException e) {
          logger.debug("Error copying Proxy-Info AVP", e);
        }
      }
    }

It is copying the content of PROXY_INFO group instead of the PROXY_INFO group 
instead. It just should copy the group as it is done with previous groups 
before.

In the RFC 3588 it states:

   -  Any Proxy-Info AVPs in the request MUST be added to the answer
      message, in the same order they were present in the request.

Regards

Original issue reported on code.google.com by kral...@gmail.com on 28 Feb 2013 at 1:47

GoogleCodeExporter commented 9 years ago
Thanks for the report. I have confirmed the issue and created a patch (along 
with a regression test case) for it.

Please find the patch attached, if no issues found, I'll be committing it in 
the next days.

Original comment by brainslog on 2 Jul 2014 at 2:04

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 95f77ae09ded.

Fixed as proposed in the patch.

Original comment by brainslog on 5 Jul 2014 at 12:47