diff src/http/modules/ngx_http_limit_zone_module.c @ 984:dd128232e6ba

count connection once per request
author Igor Sysoev <igor@sysoev.ru>
date Sun, 07 Jan 2007 17:47:17 +0000
parents 6fe76f377a62
children 14e68f471d02
line wrap: on
line diff
--- a/src/http/modules/ngx_http_limit_zone_module.c
+++ b/src/http/modules/ngx_http_limit_zone_module.c
@@ -107,6 +107,10 @@ ngx_http_limit_zone_handler(ngx_http_req
     ngx_http_limit_zone_conf_t     *lzcf;
     ngx_http_limit_zone_cleanup_t  *lzcln;
 
+    if (r->limit_zone_set) {
+        return NGX_DECLINED;
+    }
+
     lzcf = ngx_http_get_module_loc_conf(r, ngx_http_limit_zone_module);
 
     if (lzcf->shm_zone == NULL) {
@@ -119,6 +123,8 @@ ngx_http_limit_zone_handler(ngx_http_req
         return NGX_DECLINED;
     }
 
+    r->limit_zone_set = 1;
+
     len = vv->len;
 
     hash = ngx_crc32_short(vv->data, len);