[reSIProcate] Inconsisten Content parsing for Undefined content type?

FrankYuan frankyuan at emergent-netsolutions.com
Tue Jan 31 10:46:16 CST 2006


Hi,

If an undefined content type is parsed by SipMessage.cxx, the 
OctetsContents is used.
If the same undefined content in MultiMixedContents is parsed by 
Content.cxx, the GenericContents (PlainContents)  is used.
I think it is a bug.

Here are the two file source code:

file SipMessage.cxx:
Contents*
SipMessage::getContents() const
{


      if ( 
ContentsFactoryBase::getFactoryMap().find(header(h_ContentType)) == C
ontentsFactoryBase::getFactoryMap().end() )
      {
         InfoLog(<< "SipMessage::getContents: got content type ("
                 << header(h_ContentType).type()
                 << "/"
                 << header(h_ContentType).subType()
                 << ") that is not known, "
                 << "returning as opaque application/octet-stream");
     *    mContents = 
ContentsFactoryBase::getFactoryMap()[OctetContents::getStat
icType()]->create(mContentsHfv, OctetContents::getStaticType());*
      }
      else
      {
         mContents = 
ContentsFactoryBase::getFactoryMap()[header(h_ContentType)]
->create(mContentsHfv, header(h_ContentType));
      }

}

file   Contents* c;
Contents*
Contents::createContents(const Mime& contentType,
                         const Data& contents)
{
   if (ContentsFactoryBase::getFactoryMap().find(contentType) != 
ContentsFactory
Base::getFactoryMap().end())
   {
      c = ContentsFactoryBase::getFactoryMap()[contentType]->create(hfv, 
content
Type);
   }
   else
   {
     * c = new GenericContents(hfv, contentType);*
   }

}

-- 
Thanks

Frank Yuan


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20060131/69a48cbb/attachment.htm>


More information about the resiprocate-devel mailing list