Hi, Maxim!

Thanks for reviewing my patches.

>> +
>> +    if (ngx_strcmp(value[1].data, "off") == 0) {
>> +        if (cf->args->nelts != 2) {
>> +            return "has invalid number of arguments";
>> +        }
>> +
>> +        if (lccf->off || lccf->limits.elts) {
>> +            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
>> +                               "\"limit_conn off\" cannot be used with 
>> other "
>> +                               "\"limit_conn\" directives on the same 
>> level");
>> +            return NGX_CONF_ERROR;
>> +        }
>> +
>> +        lccf->off = 1;
>> +        return NGX_CONF_OK;
>> +    }
>> +
>> +    if (cf->args->nelts != 3) {
>> +        return "has invalid number of arguments";
>> +    }
>> +
>> +    if (lccf->off) {
>> +        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
>> +                           "\"limit_conn off\" cannot be used with other "
>> +                           "\"limit_conn\" directives on the same level");
>> +        return NGX_CONF_ERROR;
>> +    }
>> +

> This looks overcomplicated and far from what nginx normally prints 
> on similar errors at the same time.  It should be possible to do 
> this better.

Will the "'limit_conn' directive already defined with conflicting parameters"
message be  suitable in this case?
Which one should I use - ngx_conf_log_error() or
return 'already defined with conflicting parameter'?


-- 
Regards,
 Pavel                          mailto:[email protected]

_______________________________________________
nginx-devel mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Reply via email to