< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate] MessageDecorator bug?


        Ugh. Yeah, this is completely broken.

The reason this is biting us is that DialogUsageManager is adding the outbound decorators to long-lifetime SharedPtr<SipMessage> that live in the various subclasses of DialogUsage. We either need to have the subclasses set up the outbound decorators themselves, or stop passing their outgoing traffic with a SharedPtr (ie, have DialogUsage clone the SipMessage, put it in an auto_ptr, and fling _that_ at DialogUsageManager). My vote is for the latter, since using SharedPtr in this case doesn't make much sense anyway. We should be passing auto_ptr instead.

Best regards,
Byron Campen

Hi,
I'm testing DUM using Resiprocate release 1.4 (SVN head) and have
noticed a strange behaviour about MessageDecorator invocation while
sending a SIP message.

To reproduce the issue I changed the sample application
basicRregister.cxx file  (in "dum/test/directory") with some
modifications: I added my class SipMessageDecorator, invoked
setOutboundDecorator(), added logs and removed unregistration so that
the REGISTER message is always sent.

I set my MessageDecorator class in the main with
setOutboundDecorator() method, in this way:
SharedPtr<SipMessageDecorator> messageDecorator(new SipMessageDecorator());
clientDum.getMasterProfile()->setOutboundDecorator(messageDecorator);

After sending the first REGISTER message, the method decorateMessage()
in MessageDecorator class is called once, but the second time it is
called consecutively twice with the same message, at third REGISTER
three times (always same message) and so on.

I noticed that in DialogUsageManager the send() method adds a
MessageDecorator clone to mOutboundDecorators and the
SipMessage::callOutboundDecorator() method  calls decorateMessage()
for each item in vector mOutboundDecorators, but this vector always
grows.

I attached to this mail the changed sample application that I tested
using repro and the produced log file.

Is there a bug or my mistake?

Thank you in advance.
Best regards

Andrea Chiappori
< basicRegister .cxx><test.log>_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel

Attachment: smime.p7s
Description: S/MIME cryptographic signature