Mercurial > hg > nginx
comparison 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 |
comparison
equal
deleted
inserted
replaced
983:7a8ca436d611 | 984:dd128232e6ba |
---|---|
105 ngx_http_variable_value_t *vv; | 105 ngx_http_variable_value_t *vv; |
106 ngx_http_limit_zone_node_t *lz; | 106 ngx_http_limit_zone_node_t *lz; |
107 ngx_http_limit_zone_conf_t *lzcf; | 107 ngx_http_limit_zone_conf_t *lzcf; |
108 ngx_http_limit_zone_cleanup_t *lzcln; | 108 ngx_http_limit_zone_cleanup_t *lzcln; |
109 | 109 |
110 if (r->limit_zone_set) { | |
111 return NGX_DECLINED; | |
112 } | |
113 | |
110 lzcf = ngx_http_get_module_loc_conf(r, ngx_http_limit_zone_module); | 114 lzcf = ngx_http_get_module_loc_conf(r, ngx_http_limit_zone_module); |
111 | 115 |
112 if (lzcf->shm_zone == NULL) { | 116 if (lzcf->shm_zone == NULL) { |
113 return NGX_DECLINED; | 117 return NGX_DECLINED; |
114 } | 118 } |
116 vv = ngx_http_get_indexed_variable(r, lzcf->index); | 120 vv = ngx_http_get_indexed_variable(r, lzcf->index); |
117 | 121 |
118 if (vv == NULL || vv->not_found) { | 122 if (vv == NULL || vv->not_found) { |
119 return NGX_DECLINED; | 123 return NGX_DECLINED; |
120 } | 124 } |
125 | |
126 r->limit_zone_set = 1; | |
121 | 127 |
122 len = vv->len; | 128 len = vv->len; |
123 | 129 |
124 hash = ngx_crc32_short(vv->data, len); | 130 hash = ngx_crc32_short(vv->data, len); |
125 | 131 |