Re: [reSIProcate] More problems with `assert'
I think it would be good to understand why this is happening first -
this could be a real bug. Any idea what message type is making here and
why?
Scott
> -----Original Message-----
> From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx
> [mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of
> Daniel Pocock
> Sent: Sunday, November 05, 2006 6:37 PM
> To: resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> Subject: [reSIProcate] More problems with `assert'
>
>
>
> I occasionally see this piece of code causing trouble, assert at
> approximately line 1166 of DialogUsageManager.cxx (see code below).
>
> Is it satisfactory to change the `assert' to something less
> catastrophic, like this for example:
>
> #include <typeinfo>
> ...
> if(dynamic_cast<SipMessage*>(msg.get()) == 0)
> {
> ErrorLog(<< "discarding message of type " <<
> typeid(*(msg.get())).name() <<", transaction gone away perhaps?");
> msg.release();
> return;
> }
>
> // From DialogUsageManager.cxx:
>
> if (tid != Data::Empty && !mIncomingFeatureList.empty())
> {
> FeatureChainMap::iterator it;
> //efficiently find or create FeatureChain, should prob. be a
> utility template
> {
> FeatureChainMap::iterator lb =
> mIncomingFeatureChainMap.lower_bound(tid);
> if (lb != mIncomingFeatureChainMap.end() &&
> !(mIncomingFeatureChainMap.key_comp()(tid, lb->first)))
> {
> it = lb;
> }
> else
> {
> assert(dynamic_cast<SipMessage*>(msg.get()));
> it = mIncomingFeatureChainMap.insert(lb,
> FeatureChainMap::value_type(tid, new DumFeatureChain(*this,
> mIncomingFeatureList, *mIncomingTarget)));
> }
> }
>
> DumFeatureChain::ProcessingResult res =
> it->second->process(msg.get());
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel