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:
> Vjacheslav Chekushin wrote:
> 
>>Hi, list.
>>
>>octstr_compare() can't be used because http headers are packed by http_pack()
>>and headers can contain many values.
>>So octstr_search() must be used.
> 
> 
> ok, you consider that you have multi-valued headers, like for the
> 'Accept-Charset' headers, right? That would be a problem, yes. 
> 
> But actually I just wanted to get rid of the istrup() function and use
> Ocstr* instead. I have not claimed that it would now work even for
> multi-value headers.
> 
> Can you preliminary file this as a bug report to
> http://bugs.kannel.org/ so we keep track of it?! Thanks.

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)

> 
> 
>>By the way, why do you need octstr_convert_range() in this function if we could
>>use octstr_case_search() ?
> 
> 
> That's a good question?! ;) seems you're right here, of course. It's
> unnecessary to upcase both operands in order to have a case sensitive
> search while there is an incase sensitive search function available.
> 
> I'll change this.
> 
> 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.