Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Limit conn: Added "off" parameter to the 'limit_conn' directive

Pavel V.
February 10, 2016 12:32AM
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:pavel2000@ngs.ru

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Limit conn: Added "off" parameter to the 'limit_conn' directive

Pavel V. Rochnyack 488 February 09, 2016 01:10PM

Re: [PATCH] Limit conn: Added "off" parameter to the 'limit_conn' directive

Maxim Dounin 245 February 09, 2016 11:18PM

Re: [PATCH] Limit conn: Added "off" parameter to the 'limit_conn' directive

Pavel V. 218 February 10, 2016 12:32AM

Re: [PATCH] Limit conn: Added "off" parameter to the 'limit_conn' directive

Maxim Dounin 247 February 10, 2016 08:54AM

Re: [PATCH] Limit conn: Added "off" parameter to the 'limit_conn' directive

Valentin V. Bartenev 196 February 10, 2016 08:38AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 163
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready