Re: [BUG] http.c (http_something_accepted())

Vjacheslav Chekushin <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization LMT
Message-ID <[email protected]>
Hi, Stipe.

Stipe Tolj wrote:
>>I think, that such simple bug must not be filed into bugs.kannel.org.
>>
>>All what you need is change:
>>if (octstr_compare(header_value, oswhat) == 0)
>>
>>to:
>>
>>if (octstr_search(header_value, oswhat, 0) >= 0)
> 
> 
> ok, so want it the "dirty" way ;)
> 
> I thought of parsing a HTTP multi-value and provide a List* structure
> that then is searched for a specific element. 

Anyway we must not use octstr_compare, but octstr_search
Example:
phone sends Accept: text/plain; q=0.5
http server sends content text/plain.
So now octstr_compare("text/plain; q=0.5", "text/plain") != 0,
and conclusion from http_something_accept: text/plain not acceptable.

> 
> This "multi-value HTTP representation" may be then used for several
> other header types too, like 'Content-Type', which can look very
> complex in some cases.
> 
> Stipe
> 
> 


-- 
Vjacheslav Chekushin                                mailto:[email protected]
Latvian Mobile Phone Company                        http://www.lmt.lv
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.