[reSIProcate] MessageDecorator bug?

Byron Campen bcampen at estacado.net
Wed Oct 29 15:54:30 CDT 2008


	Looking at the old code, it looks like daniel set this stuff up with  
SharedPtr a few years ago. Is there a reason we need to keep doing it  
this way?

Best regards,
Byron Campen

> 	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 at resiprocate.org
>> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel at resiprocate.org
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2482 bytes
Desc: not available
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20081029/2dce189c/attachment.bin>


More information about the resiprocate-devel mailing list