Mercurial > hg > nginx
comparison src/http/modules/ngx_http_limit_conn_module.c @ 4458:2d4ff8bd5649
Limit conn: returned to the old behavior of using the first actual limit on
the way.
It was unintentionally changed in r4272, so that it could only limit the first
location where the processing of the request has reached PREACCESS phase.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Fri, 10 Feb 2012 10:48:58 +0000 |
parents | d620f497c50f |
children | 95ab6658654a |
comparison
equal
deleted
inserted
replaced
4457:50f463258eea | 4458:2d4ff8bd5649 |
---|---|
157 | 157 |
158 if (r->main->limit_conn_set) { | 158 if (r->main->limit_conn_set) { |
159 return NGX_DECLINED; | 159 return NGX_DECLINED; |
160 } | 160 } |
161 | 161 |
162 r->main->limit_conn_set = 1; | |
163 | |
164 lccf = ngx_http_get_module_loc_conf(r, ngx_http_limit_conn_module); | 162 lccf = ngx_http_get_module_loc_conf(r, ngx_http_limit_conn_module); |
165 limits = lccf->limits.elts; | 163 limits = lccf->limits.elts; |
166 | 164 |
167 for (i = 0; i < lccf->limits.nelts; i++) { | 165 for (i = 0; i < lccf->limits.nelts; i++) { |
168 ctx = limits[i].shm_zone->data; | 166 ctx = limits[i].shm_zone->data; |
184 "the value of the \"%V\" variable " | 182 "the value of the \"%V\" variable " |
185 "is more than 255 bytes: \"%v\"", | 183 "is more than 255 bytes: \"%v\"", |
186 &ctx->var, vv); | 184 &ctx->var, vv); |
187 continue; | 185 continue; |
188 } | 186 } |
187 | |
188 r->main->limit_conn_set = 1; | |
189 | 189 |
190 hash = ngx_crc32_short(vv->data, len); | 190 hash = ngx_crc32_short(vv->data, len); |
191 | 191 |
192 shpool = (ngx_slab_pool_t *) limits[i].shm_zone->shm.addr; | 192 shpool = (ngx_slab_pool_t *) limits[i].shm_zone->shm.addr; |
193 | 193 |