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

[reSIProcate] Endless loop?


I could be mistaken but I believe the following code in InviteSession.cxx will create an endless loop.

 

I believe we meant to say mInviteSession.refer(mReferTo, mReferSub).

 

Currently this would continue to call itself by posting this message into the fifo an endless number of times.

 

Let me know if I am mistaken.

 

 

 

 

void

InviteSession::referCommand(const NameAddr& referTo, bool referSub)

{

   mDum.post(new InviteSessionReferCommand(*this, referTo, referSub));

}

 

class InviteSessionReferCommand : public DumCommandAdapter

{

public:

   InviteSessionReferCommand(InviteSession& inviteSession, const NameAddr& referTo, bool referSub)

      : mInviteSession(inviteSession),

      mReferTo(referTo),

      mReferSub(referSub)

   {

 

   }

 

   virtual void executeCommand()

   {

      mInviteSession.referCommand(mReferTo, mReferSub);

   }

 

   virtual std::ostream& encodeBrief(std::ostream& strm) const

   {

      return strm << "InviteSessionReferCommand";

   }

 

private:

   InviteSession& mInviteSession;

   NameAddr mReferTo;

   bool mReferSub;

};