Hi Marius,<br><br>Thanks for the response.. I checked the other functions, but they don&#39;t have the check for ret !=end, but they check the pointer and if it is comma then loop through again until it find all the media types.<br>
<br>As per the RFC3261 multiple media-types are not supoorted in the Content-Type. So I&#39;m not sure why the author used comma to determine multiple media types . Probably just followed like Route or Record-Route headers..??<br>
<pre><font size="4"><a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-content_type.html" class="keyword" name="d4e504594">Content-Type</a>     =  ( &quot;<a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-content_type.html" class="keyword" name="d4e504597">Content-Type</a>&quot; / &quot;c&quot; ) HCOLON <a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-media-type.html" class="keyword" name="d4e504601">media-type</a><br>
<a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-media-type.html" class="keyword" name="d4e504605">media-type</a>       =  m-type SLASH m-subtype *(SEMI m-parameter)<br>m-type           =  discrete-type / <a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-composite.html" class="keyword" name="d4e504610">composite</a>-type<br>
discrete-type    =  &quot;text&quot; / &quot;<a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-image.html" class="keyword" name="d4e504616">image</a>&quot; / &quot;<a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-audio.html" class="keyword" name="d4e504619">audio</a>&quot; / &quot;video&quot;<br>
                    / &quot;application&quot; / extension-<a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-token.html" class="keyword" name="d4e504624">token</a><br><a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-composite.html" class="keyword" name="d4e504628">composite</a>-type   =  &quot;message&quot; / &quot;multipart&quot; / extension-<a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-token.html" class="keyword" name="d4e504632">token</a><br>
<br>   Record-Route  =  &quot;Record-Route&quot; HCOLON rec-route *(COMMA rec-route)</font><br><br><font size="4">Thanks<br>Jijo<br></font></pre><br><br><div class="gmail_quote">On Thu, Aug 18, 2011 at 2:23 AM, Bucur Marius <span dir="ltr">&lt;<a href="mailto:bucur_marius_ovidiu@yahoo.com">bucur_marius_ovidiu@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello Jijo,<br>
<br>
It seems like the decode_mime_type is a somehow broken. The comma is very well allowed in boundary, as you said. The BNF specified in RFC2046 permits it.<br>
But, the decode_mime_type function ignores everything coming after comma. More than that, it notifies the function caller that this content type has multiple mime types.<br>
I think the author of the function thought of something like:<br>
<br>
Content-Type: text/html, image/jpeg // very weird, though<br>
<br>
This is wrong, hence the comma can be in a parameter (like in your case).<br>
I think the best fix, as you said is to remove that check, hence a non-NULL return value doesn&#39;t mean anything (that the content type has multiple mime types).<br>
Another fix is to write a &quot;good&quot; decode_mime_type, that checks if the comma is inside a parameter. I don&#39;t know if effort is worth it.<br>
<br>
One thing we need to do is to check if there are any functions in Kamailio that call decode_mime_type and also perform this check (ret != end).<br>
<br>
Cheers,<br>
Marius<br>
<br>
<br>
________________________________<br>
From: Jijo &lt;<a href="mailto:realjijo@gmail.com">realjijo@gmail.com</a>&gt;<br>
To: <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>; <a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
Sent: Wednesday, August 17, 2011 10:54 AM<br>
Subject: [SR-Users] decode_mime_type error<br>
<div><div></div><div class="h5"><br>
<br>
Hi All,<br>
<br>
The function parse_content_type_hdr() is failing in decode_mime_type() when Content-Type parameter &quot;boundary&quot; has value comma as below. The error message is &quot;ERROR:parse_content_type_hdr: CONTENT_TYPE hdr contains &quot;<br>

            &quot;more then one mime type :-(!<br>
<br>
Content Type Header is as below, It works fine if the boundary value is without comma.<br>
<br>
Content-Type: multipart/mixed;boundary=&quot;,AW&quot;<br>
<br>
The parse_content_type_hdr() is failing in the following code,<br>
<br>
    ret = decode_mime_type(msg-&gt;content_type-&gt;body.s, end , &amp;mime);<br>
    if (ret==0)<br>
        goto error;<br>
    if (ret!=end) {<br>
<br>
         LOG(L_INFO,&quot;ERROR:parse_content_type_hdr: CONTENT_TYPE hdr contains &quot;<br>
            &quot;more then one mime type :-(!\n&quot;);<br>
           goto error ;<br>
    }<br>
<br>
I thought of fixing this issue by commenting the code for condition ret !=end. I&#39;m  not sure why we we need that check, as mime variable has the information to process the content.<br>
<br>
Please let me know if you see any impact.<br>
<br>
Thanks<br>
Jijo<br>
<br>
<br>
<br>
<br>
<br>
</div></div>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>      <br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div><br>