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

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


Thanks John!  I have committed this fix.

Scott


On Mon, May 19, 2014 at 12:58 PM, John Gregg <jgregg@xxxxxxxxx> 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@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel