Welcome! Log In Create A New Profile

Advanced

Patch to handle 204 on limit_req_status

Kohei Ozaki
September 20, 2013 08:14PM
Hello nginx-devel guys,

I've made small changes in the bounds-check of
limit_req_status/limit_conn_status directives.

In OpenRTB (Real-time Bidding) protocol, "No-Bids" on all impressions
are indicated as HTTP 204 response.
It would be useful to handle 204 on limit_req_status/limit_conn_status
directives.

* ref: "OpenRTB API Specification"
http://www.iab.net/media/file/OpenRTB-API-Specification-Version-2-1-FINAL.pdf

I hope it will be accepted if it is suitable.
The patch to handle HTTP 2xx (not include 200) response is the following:

````
diff --git a/src/http/modules/ngx_http_limit_conn_module.c
b/src/http/modules/ngx_http_limit_conn_module.c
index 7f0eea7..0d29f6b 100644
--- a/src/http/modules/ngx_http_limit_conn_module.c
+++ b/src/http/modules/ngx_http_limit_conn_module.c
@@ -76,7 +76,7 @@ static ngx_conf_enum_t ngx_http_limit_conn_log_levels[] = {


static ngx_conf_num_bounds_t ngx_http_limit_conn_status_bounds = {
- ngx_conf_check_num_bounds, 400, 599
+ ngx_conf_check_num_bounds, 201, 599
};


diff --git a/src/http/modules/ngx_http_limit_req_module.c
b/src/http/modules/ngx_http_limit_req_module.c
index 90434c9..f1899ef 100644
--- a/src/http/modules/ngx_http_limit_req_module.c
+++ b/src/http/modules/ngx_http_limit_req_module.c
@@ -86,7 +86,7 @@ static ngx_conf_enum_t ngx_http_limit_req_log_levels[] = {


static ngx_conf_num_bounds_t ngx_http_limit_req_status_bounds = {
- ngx_conf_check_num_bounds, 400, 599
+ ngx_conf_check_num_bounds, 201, 599
};
````


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

Patch to handle 204 on limit_req_status Attachments

Kohei Ozaki 1179 September 20, 2013 08:14PM

Re: Patch to handle 204 on limit_req_status

Maxim Dounin 562 September 20, 2013 09:22PM

Re: Patch to handle 204 on limit_req_status

Kohei Ozaki 709 September 20, 2013 10:46PM



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

Online Users

Guests: 192
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready