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

John Gregg jgregg at aylus.com
Mon May 19 11:58:23 CDT 2014


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20140519/a05fa1c9/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TransactionState.cxx
Type: text/x-c++src
Size: 102525 bytes
Desc: not available
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20140519/a05fa1c9/attachment.cxx>


More information about the resiprocate-devel mailing list