image_filter enhancement

Ruslan Khusnullin ruslan.khusnullin at gmail.com
Tue Dec 4 14:39:11 UTC 2012


On Tue, Dec 4, 2012 at 5:08 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
>> -    n = ngx_atoi(value->data, value->len);
>> +    if (ngx_strcmp(value->data, "center") == 0) {
>> +        return NGX_HTTP_IMAGE_OFFSET_CENTER;
...
> I'm not happy with this change as it degrades performance of other
...

Is it safe to do ngx_strcmp (ngx_str_t.data, "string")? As far as I
know ngx_str_t.data may have no zero at the end. I always do
ngx_strncmp (ngx_str_t.data, "string", ngx_str_t.len). Does it make
sense?



More information about the nginx-devel mailing list