[reSIProcate] TransactionState::sendCurrentToWire() uses wrong target in server/force target case

Scott Godin sgodin at sipspectrum.com
Thu May 22 07:49:57 CDT 2014


Thanks John!  I have committed this fix.

Scott


On Mon, May 19, 2014 at 12:58 PM, John Gregg <jgregg at aylus.com> wrote:

>
> In 1.9.6 of TransactionState.cxx, in
> TransactionState::sendCurrentToWire(), starting on line 2542, this code
> looks wrong. In particular, note how the code carefully sets up the local
> variable target, but never uses it, instead passing the (empty) member
> variable mTarget to the transmit() routine:
>
>
>          if (sip->hasForceTarget())
>          {
>             // ?bwc? Override the target for a single response? Should we
> even
>             // allow this? What about client transactions? Should we
> overwrite
>             // mResponseTarget here? I don't think this has been thought
> out properly.
>             Tuple target = simpleTupleForUri(sip->getForceTarget());
>             StackLog(<<"!ah! response with force target going to :
> "<<target);
>             transmitState=mController.mTransportSelector.transmit(
>                         sip,
>                         mTarget,
>                         mIsReliable ? 0 : &mMsgToRetransmit);
>          }
>
> This results in an assert in transmit() when it can't successfully do a
> transport=findTransportByDest(target) in the response case. We found it
> necessary to change the above code to this (modified source file attached):
>
>          if (sip->hasForceTarget())
>          {
>             // ?bwc? Override the target for a single response? Should we
> even
>             // allow this? What about client transactions? Should we
> overwrite
>             // mResponseTarget here? I don't think this has been thought
> out properly.
>             Tuple target = simpleTupleForUri(sip->getForceTarget());
>             StackLog(<<"!ah! response with force target going to :
> "<<target);
>             transmitState=mController.mTransportSelector.transmit(
>                         sip,
> // AYLUS_CHANGE: bug in resiprocate? Use target we just set up, not member
> mTarget.                       mTarget,
>                         target,
>                         mIsReliable ? 0 : &mMsgToRetransmit);
>          }
>
> -John Gregg
>
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel at resiprocate.org
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20140522/787abb3a/attachment.htm>


More information about the resiprocate-devel mailing list