constness of key in ngx_hash_find_

Arvind Jayaprakash work at anomalizer.net
Sun Dec 7 09:03:57 MSK 2008


Igor Sysoev wrote:
  >> Igor Sysoev wrote:
>>> Do you mean
>>>
>>> -void *ngx_hash_find(ngx_hash_t *hash, ..., u_char *name,
>>> +void *ngx_hash_find(const ngx_hash_t *hash, ..., const u_char *name,
>>>
>>> But what will this improve ?
> 
> OK, I will change this eventually.

Here is my first set of changes: I've worked only on the ngx_string.* 
files at this point and it seems to break nothing in terms of compilation.

I've left out a few functions for the following reasons:
_ngx_strlchr_, _ngx_strnstr_, _ngx_strstrn_, _ngx_strcasestrn_ return an 
address in the input string; so they are not const
_ngx_utf8_length_, _ngx_utf8_cpystrn_ seem to modify the input string (I 
don't know why a length function tries to modify the content of a string)
_ngx_unescape_uri_ again, I dont know why the source string is being 
modified here.

If you find these patches ok, I'll continue my work on rest of the code 
base.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ngx_string.h.patch
URL: <http://nginx.org/pipermail/nginx/attachments/20081207/73600d30/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ngx_string.c.patch
URL: <http://nginx.org/pipermail/nginx/attachments/20081207/73600d30/attachment-0001.ksh>


More information about the nginx mailing list