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

Valentin V. Bartenev vbart at nginx.com
Wed Feb 10 13:37:29 UTC 2016


On Wednesday 10 February 2016 00:09:09 Pavel V. Rochnyack wrote:
> # HG changeset patch
> # User Pavel V. Rochnyack <pavel2000 at ngs.ru>
> # Date 1454835814 -21600
> # Node ID b4748ebdd06ba79aa27e0c54fc1d627d13966bed
> # Parent  3577c021f21eb4de6d09c1d624ba77ee9ee1eb6d
> Limit conn: Added "off" parameter to the 'limit_conn' directive.
> 
> Added support for inherited "limit_conn" directives disable.
> 
> diff -r 3577c021f21e -r b4748ebdd06b src/http/modules/ngx_http_limit_conn_module.c
> --- a/src/http/modules/ngx_http_limit_conn_module.c	Fri Feb 05 21:48:25 2016 +0300
> +++ b/src/http/modules/ngx_http_limit_conn_module.c	Sun Feb 07 15:03:34 2016 +0600
> @@ -40,6 +40,7 @@ typedef struct {
>      ngx_array_t                limits;
>      ngx_uint_t                 log_level;
>      ngx_uint_t                 status_code;
> +    ngx_uint_t                 off;            /* unsigned  off:1 */
>  } ngx_http_limit_conn_conf_t;
[..]

Instead of adding additional flag, it should be possible to replace the "limits"
array with a pointer and use NULL as an indicator of the "off" value.

That should simplify the code.

  wbr, Valentin V. Bartenev



More information about the nginx-devel mailing list